Skip to content

Commit

Permalink
Gitlab CI and Travis
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
bjvrielink committed Apr 10, 2019
1 parent 76cd666 commit b1ce43f
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 18 deletions.
53 changes: 40 additions & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -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]
13 changes: 9 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,21 @@ 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
- PUBLISHER_LOGIN=abrader

notifications:
email: false
webhooks:
urls:
- 'https://webhooks.gitter.im/e/16f24db0492933fce79d'
on_success: change
on_failure: always
on_start: false
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ end

group :test do
gem 'rake'
gem 'puppet', *location_for(ENV['PUPPET_LOCATION'] || '~> 5.5.0')
gem 'puppet', *location_for(ENV['PUPPET_LOCATION'] || '~> 3.7.0')
gem 'puppetlabs_spec_helper'
gem 'webmock'
gem 'vcr'
Expand Down

0 comments on commit b1ce43f

Please sign in to comment.