11name : " ci"
22
33on :
4- pull_request :
5- branches :
6- - " main"
4+ pull_request_target :
5+ types : [opened, synchronize, reopened]
76 workflow_dispatch :
87
98jobs :
109 Spec :
11- name : " Spec tests (Puppet: ${{matrix.puppet_version}}, Ruby Ver: ${{matrix.ruby_version}})"
12- runs-on : ubuntu-latest
13- strategy :
14- fail-fast : false
15- matrix : ${{ fromJson( vars.spec_matrix ) }}
10+ uses : " puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
11+ with :
12+ runs_on : " ubuntu-20.04"
13+ secrets : " inherit"
1614
17- env :
18- PUPPET_GEM_VERSION : ${{ matrix.puppet_version }}
19- FACTER_GEM_VERSION : ' https://github.com/puppetlabs/facter#main' # why is this set?
15+ setup_matrix :
16+ name : " Setup Test Matrix"
17+ needs : Spec
18+ runs-on : " ubuntu-20.04"
19+ outputs :
20+ matrix : ${{ steps.get-matrix.outputs.matrix }}
2021
2122 steps :
2223 - name : " Checkout"
@@ -25,28 +26,21 @@ jobs:
2526 - name : " Setup ruby"
2627 uses : " ruby/setup-ruby@v1"
2728 with :
28- ruby-version : ${{matrix.ruby_version}}
29+ ruby-version : " 2.7 "
2930 bundler-cache : true
3031
31- - name : " Bundle environment"
32- run : |
33- bundle env
34-
35- - name : " Run Static & Syntax Tests"
32+ - name : Setup Test Matrix
33+ id : get-matrix
3634 run : |
37- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
38-
39- - name : " Run tests"
40- run : |
41- bundle exec rake parallel_spec
35+ bundle exec matrix_from_metadata_v2 --provision-service
4236
4337 Acceptance :
4438 name : " Acceptance tests (${{matrix.platforms.label}}, ${{matrix.collection}})"
45- needs : Spec
39+ needs : setup_matrix
4640 runs-on : ubuntu-latest
4741 strategy :
4842 fail-fast : false
49- matrix : ${{ fromJson( vars. matrix ) }}
43+ matrix : ${{fromJson(needs.setup_matrix.outputs. matrix) }}
5044
5145 env :
5246 PUPPET_GEM_VERSION : ' ~> 7.24'
0 commit comments