Select Git revision
gitlab-ci.yml
gitlab-ci.yml 3.12 KiB
variables:
CI: "true"
RAILS_ENV: test
GEM_HOME: vendor/gems
BUNDLE_PATH: vendor/bundle
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:
- rails
cache:
when: always
paths:
- vendor/gems
before_script:
- wget --quiet "https://git-ce.rwth-aachen.de/noc-public/noc-netze-gitlab-cicd/-/raw/main/rails/rubocop.yml" -O ".rubocop.yml"
- gem install --conservative rubocop:1.65.1 rubocop-capybara:2.21.0 rubocop-minitest:0.35.1 rubocop-performance:1.21.1 rubocop-rails:2.25.1 --silent
script:
- rubocop
erb_lint:
stage: test
image: ruby:$RUBY_VERSION
tags:
- rails
cache:
when: always
paths:
- vendor/gem
before_script:
- wget --quiet "https://git-ce.rwth-aachen.de/noc-public/noc-netze-gitlab-cicd/-/raw/main/rails/rubocop.yml" -O ".rubocop.yml"
- wget --quiet "https://git-ce.rwth-aachen.de/noc-public/noc-netze-gitlab-cicd/-/raw/main/rails/erb-lint.yml" -O ".erb-lint.yml"
- gem install --conservative rubocop:1.65.1 rubocop-capybara:2.21.0 rubocop-minitest:0.35.1 rubocop-performance:1.21.1 rubocop-rails:2.25.1 erb_lint:0.6.0 --silent
script:
- erblint --lint-all --allow-no-files true
haml_lint:
stage: test
image: ruby:$RUBY_VERSION
tags:
- rails
cache:
when: always
paths:
- vendor/gems
before_script:
- wget --quiet "https://git-ce.rwth-aachen.de/noc-public/noc-netze-gitlab-cicd/-/raw/main/rails/rubocop.yml" -O ".rubocop.yml"
- wget --quiet "https://git-ce.rwth-aachen.de/noc-public/noc-netze-gitlab-cicd/-/raw/main/rails/haml-lint.yml" -O ".haml-lint.yml"
- gem install --conservative rubocop:1.65.1 rubocop-capybara:2.21.0 rubocop-minitest:0.35.1 rubocop-performance:1.21.1 rubocop-rails:2.25.1 haml_lint:0.58.0 --silent
script:
- haml-lint
brakeman:
stage: test
image: ruby:$RUBY_VERSION
tags:
- rails
cache:
when: always
paths: