Skip to content
Snippets Groups Projects
Select Git revision
  • 0a75999392e28f73d810908e59d1fff82712a560
  • main default protected
2 results

gitlab-ci-for-gem.yml

Blame
  • gitlab-ci-for-gem.yml 2.12 KiB
    variables:
      CI: "true"
      RAILS_ENV: test
    
    set_ruby_version:
      stage: build
      script:
        - echo "RUBY_VERSION=$(cat .ruby-version | sed 's/ruby-//g')" >> build.env
      artifacts:
        reports:
          dotenv: build.env
        expire_in: 1 week
    
    rubocop:
      stage: test
      image: ruby:$RUBY_VERSION
      tags:
        - gem
      script:
        - wget --quiet "https://git-ce.rwth-aachen.de/noc-public/noc-netze-gitlab-cicd/-/raw/main/ruby/rubocop-for-gem.yml" -O ".rubocop.yml"
        - gem install rubocop:1.75.6 rubocop-capybara:2.22.1 rubocop-minitest:0.38.0 rubocop-performance:1.25.0 rubocop-rails:2.31.0 --silent
        - gem install itc-gem_rubocop:0.1.4 --source=https://noc-portal.itc.rwth-aachen.de/geminabox --silent
        - rubocop
    
    erb_lint:
      stage: test
      image: ruby:$RUBY_VERSION
      tags:
        - gem
      script:
        - wget --quiet "https://git-ce.rwth-aachen.de/noc-public/noc-netze-gitlab-cicd/-/raw/main/ruby/rubocop-for-gem.yml" -O ".rubocop.yml"
        - wget --quiet "https://git-ce.rwth-aachen.de/noc-public/noc-netze-gitlab-cicd/-/raw/main/ruby/erb_lint.yml" -O ".erb_lint.yml"
        - gem install rubocop:1.75.6 rubocop-capybara:2.22.1 rubocop-minitest:0.38.0 rubocop-performance:1.25.0 rubocop-rails:2.31.0 erb_lint:0.9.0 --silent
        - gem install itc-gem_rubocop:0.1.4 --source=https://noc-portal.itc.rwth-aachen.de/geminabox --silent
        - erb_lint --lint-all --allow-no-files true
    
    haml_lint:
      stage: test
      image: ruby:$RUBY_VERSION
      tags:
        - gem
      script:
        - wget --quiet "https://git-ce.rwth-aachen.de/noc-public/noc-netze-gitlab-cicd/-/raw/main/ruby/rubocop-for-gem.yml" -O ".rubocop.yml"
        - wget --quiet "https://git-ce.rwth-aachen.de/noc-public/noc-netze-gitlab-cicd/-/raw/main/ruby/haml-lint.yml" -O ".haml-lint.yml"
        - gem install rubocop:1.75.6 rubocop-capybara:2.22.1 rubocop-minitest:0.38.0 rubocop-performance:1.25.0 rubocop-rails:2.31.0 haml_lint:0.62.0 --silent
        - gem install itc-gem_rubocop:0.1.4 --source=https://noc-portal.itc.rwth-aachen.de/geminabox --silent
        - haml-lint
    
    test:
      stage: test
      image: ruby:$RUBY_VERSION
      tags:
        - gem
      script:
        - gem install bundler --silent
        - bundle install --jobs $(nproc) --quiet
        - rake test