Skip to content
Snippets Groups Projects
Select Git revision
  • 05bc91b9cd2e7774434e12b62699387daa9ed0b6
  • main default protected
2 results

gitlab-ci.yml

Blame
  • gitlab-ci.yml 1.62 KiB
    stages:
      - detect_ruby
      - test
    
    default:
      tags:
        - rails
      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"
        - wget --quiet "https://git-ce.rwth-aachen.de/noc-public/noc-netze-gitlab-cicd/-/raw/main/rails/haml-lint.yml" -O ".haml-lint.yml"
        - rm -f ./config/brakeman.yml ./config/brakeman.ignore
        - gem install bundler --silent && bundle install --quiet
    
    variables:
      RAILS_ENV: test
    
    detect_ruby:
      stage: detect_ruby
      script: echo "RUBY_VERSION=$(cat .ruby-version | sed 's/ruby-//g')" >> build.env
      artifacts:
        reports:
          dotenv: build.env
    
    rubocop:
      image: ruby:$RUBY_VERSION
      stage: test
      script:
        - rubocop
    
    erb_lint:
      image: ruby:$RUBY_VERSION
      stage: test
      script:
        - erblint --lint-all --allow-no-files true
    
    haml_lint:
      image: ruby:$RUBY_VERSION
      stage: test
      script:
        - haml-lint
    
    brakeman:
      image: ruby:$RUBY_VERSION
      stage: test
      script:
        - brakeman -A --except UnscopedFind
    
    rails_test:
      image: ruby:$RUBY_VERSION
      stage: test
      script:
        - bin/rails db:prepare test
    
    #rails_system_test:
    #  image: ruby:$RUBY_VERSION
    #  stage: test
    #  services:
    #    - selenium/standalone-chrome:latest
    #  variables:
    #    SELENIUM_URL: http://selenium__standalone-chrome:4444/wd/hub
    #  artifacts:
    #    when: on_failure
    #    paths:
    #      - tmp/screenshots
    #      - /tmp/chrome.log
    #      - log/test.log
    #   expire_in: 1 week
    #  script:
    #    - bin/rails db:prepare test:system