From a82735c9a46042b6f3a76a8856db6eaaca4693d4 Mon Sep 17 00:00:00 2001 From: Bart-Jan Vrielink Date: Wed, 10 Apr 2019 13:56:40 +0200 Subject: [PATCH] Gitlab CI and Travis - Deleted some non-supported combinations of Puppet and Ruby from Travis Matrix - Added some form of matrix for Gitlab CI - Gitlab CI fixes for old Puppet versions --- .gitlab-ci.yml | 53 +++++++++++++++++++++++++++++++++++++------------- .travis.yml | 5 ++--- 2 files changed, 42 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 03e9039..88d2b1e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,34 +1,61 @@ -image: "ruby:2.4.5" - +--- cache: paths: - vendor/ruby - spec/fixtures variables: + +.puppet400: &puppet400 + PUPPET_LOCATION: 4.0.0 + BUNDLER: '1.7.3' + +.puppet41012: &puppet41012 PUPPET_LOCATION: 4.10.12 + BUNDLER: '1.7.3' -before_script: - - gem install bundler --no-document - - bundle install -j $(nproc) --path vendor +.puppet550: &puppet550 + PUPPET_LOCATION: 5.5.0 + BUNDLER: '>= 0' -test-syntax: - stage: test +.syntax: &syntax script: - bundle exec rake syntax -test-validate: - stage: test +.validate: &validate script: - bundle exec rake validate -test-lint: - stage: test +.lint: &lint script: - bundle exec rake lint -test-rspec: - stage: test +.spec: &spec script: - bundle exec rake spec SPEC_OPTS='--format documentation' coverage: '/Resource coverage: \d+\.\d+/' + +before_script: + - gem install bundler --no-document --version "$BUNDLER" + - bundle install -j $(nproc) --path vendor --without development acceptance + +puppet41012_test: + stage: test + image: "ruby:2.1.9" + <<: [*syntax, *validate, *lint, *spec] + variables: + <<: [*puppet41012] + +puppet550_test: + image: "ruby:2.4.5" + stage: test + <<: [*syntax, *validate, *lint, *spec] + variables: + <<: [*puppet550] + +puppet400_test: + stage: test + image: "ruby:2.1.9" + <<: [*syntax, *validate, *lint, *spec] + variables: + <<: [*puppet400] diff --git a/.travis.yml b/.travis.yml index 9fd46ac..0a3343e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,13 +22,12 @@ env: - PUPPET_LOCATION="~> 3.6.0" - PUPPET_LOCATION="~> 3.7.0" - PUPPET_LOCATION="~> 4.0.0" - - PUPPET_LOCATION="~> 5.5.0" matrix: include: - - rvm: 1.9.3 - env: PUPPET_LOCATION="~> 3.2.0" - rvm: 2.0.0 env: PUPPET_LOCATION="~> 3.3.0" + - rvm: 2.4.5 + env: PUPPET_LOCATION="~> 5.5.0" global: - PUBLISHER_LOGIN=bjvrielink