---
default:
  before_script:
    - apt-get update -qy
    - apt-get install -y libapt-pkg-dev
    - ruby -v
    - which ruby
    - gem install bundler --no-document
    - bundle install --jobs $(nproc)  "${FLAGS[@]}"

test:2.3:
  image: 'ruby:2.3'
  script:
    - bundle exec rake

test:2.4:
  image: 'ruby:2.4'
  script:
    - bundle exec rake

test:2.5:
  image: 'ruby:2.5'
  script:
    - bundle exec rake

test:2.6:
  image: 'ruby:2.6'
  script:
    - bundle exec rake

test:2.7:
  image: 'ruby:2.7'
  script:
    - bundle exec rake

---
stages:
  - lint
  - test

.tests:
  before_script:
    - apt-get update -qy
    - apt-get install -y libapt-pkg-dev
    - ruby -v
    - which ruby
    - gem install bundler --no-document
    - bundle install --jobs $(nproc)  "${FLAGS[@]}"
  script: rake test
  stage: test

test:2.3:
  extends: .tests
  image: 'ruby:2.3'
  script:
    - bundle exec rake

test:2.4:
  extends: .tests
  image: 'ruby:2.4'
  script:
    - bundle exec rake

test:2.5:
  extends: .tests
  image: 'ruby:2.5'
  script:
    - bundle exec rake

test:2.6:
  extends: .tests
  image: 'ruby:2.6'
  script:
    - bundle exec rake

test:2.7:
  extends: .tests
  image: 'ruby:2.7'
  script:
    - bundle exec rake

lint:
  before_script:
    - apt-get update -qy
    - apt-get install -y libapt-pkg-dev cppcheck
    - ruby -v
    - which ruby
    - gem install bundler --no-document
    - bundle install --jobs $(nproc)  "${FLAGS[@]}"
  image: 'ruby:2.7-slim'
  script:
    - bundle exec rake cppcheck
  stage: lint

Add lint to gitlab ci
Add lint to gitlab ci
