Skip to content

Commit

Permalink
Update test suite.
Browse files Browse the repository at this point in the history
  • Loading branch information
bschonec committed May 20, 2024
1 parent 23a79f7 commit d13986e
Showing 1 changed file with 41 additions and 118 deletions.
159 changes: 41 additions & 118 deletions .github/workflows/test-suite.yaml
Original file line number Diff line number Diff line change
@@ -1,128 +1,51 @@
name: Test suite
name: Test

on:
pull_request: {}
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches:
- master

env:
BUNDLE_WITHOUT: release

jobs:
test-static-current:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
puppet: [7.22.0]
ruby: [3.0.5, 3.1.3]

name: Static code analysis
runs-on: ubuntu-20.04
permissions:
contents: read

ruby:
- "3.2"
- "3.1"
- "3.0"
- "2.7"
puppet:
- "~> 8.0"
- "~> 7.24"
exclude:
- ruby: "3.0"
puppet: "~> 8.0"
- ruby: "2.7"
puppet: "~> 8.0"
name: "Ruby ${{ matrix.ruby }} - Puppet ${{ matrix.puppet }}"
env:
PUPPET_VERSION: ${{ matrix.puppet }}
steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
env:
PUPPET_VERSION: ${{ matrix.puppet }}

- name: Run metadata lint
run: |
PUPPET_VERSION=${{ matrix.puppet }} bundle exec rake metadata_lint
- name: Run puppet lint
run: |
PUPPET_VERSION=${{ matrix.puppet }} bundle exec rake lint
- name: Run puppet syntax check
run: |
PUPPET_VERSION=${{ matrix.puppet }} bundle exec rake syntax
- name: Run puppet rspec tests
run: |
PUPPET_VERSION=${{ matrix.puppet }} STRICT_VARIABLES=yes bundle exec rake spec
- name: Run rubocop tests
run: |
PUPPET_VERSION=${{ matrix.puppet }} bundle exec rake rubocop
test-static-old:
strategy:
fail-fast: false
matrix:
puppet: [5.5.22, 6.29.0]
ruby: [2.5.9, 2.6.9]

name: Static code analysis
runs-on: ubuntu-20.04
permissions:
contents: read

- uses: actions/checkout@v3
- name: Install Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Build gem
run: gem build --strict --verbose *.gemspec
- name: Run tests
run: bundle exec rake spec
tests:
needs:
- test
runs-on: ubuntu-latest
name: Test suite
steps:
- uses: actions/checkout@v3

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
env:
PUPPET_VERSION: ${{ matrix.puppet }}

- name: Run metadata lint
run: |
PUPPET_VERSION=${{ matrix.puppet }} bundle exec rake metadata_lint
- name: Run puppet lint
run: |
PUPPET_VERSION=${{ matrix.puppet }} bundle exec rake lint
- name: Run puppet syntax check
run: |
PUPPET_VERSION=${{ matrix.puppet }} bundle exec rake syntax
- name: Run puppet rspec tests
run: |
PUPPET_VERSION=${{ matrix.puppet }} STRICT_VARIABLES=yes bundle exec rake spec
- name: Run rubocop tests
run: |
PUPPET_VERSION=${{ matrix.puppet }} bundle exec rake rubocop
test-integration:
strategy:
fail-fast: false
matrix:
puppet: [puppet6, puppet7]
beakerset: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, centos-7, debian-10, debian-11]

name: Integration tests
runs-on: ubuntu-20.04
permissions:
contents: read

steps:
- uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.9
bundler-cache: true
env:
BEAKER_set: ${{ matrix.beakerset }}
BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet }}
PUPPET_INSTALL_TYPE: agent

- name: Run puppet-beaker tests
run: |
BEAKER_destroy=yes bundle exec rake acceptance
env:
BEAKER_set: ${{ matrix.beakerset }}
BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet }}
PUPPET_INSTALL_TYPE: agent

- run: echo Test suite completed

0 comments on commit d13986e

Please sign in to comment.