Skip to content

Commit cf9aaed

Browse files
author
jordanbreen28
committed
(maint) - Update CI Workflows
1 parent 05a0d2c commit cf9aaed

File tree

2 files changed

+34
-45
lines changed

2 files changed

+34
-45
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
name: "ci"
22

33
on:
4-
pull_request:
5-
branches:
6-
- "main"
4+
pull_request_target:
5+
types: [opened, synchronize, reopened]
76
workflow_dispatch:
87

98
jobs:
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'

.github/workflows/nightly.yml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ on:
77

88
jobs:
99
Spec:
10-
name: "Spec tests (Puppet: ${{matrix.puppet_version}}, Ruby Ver: ${{matrix.ruby_version}})"
11-
runs-on: ubuntu-latest
12-
strategy:
13-
fail-fast: false
14-
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"
1514

16-
env:
17-
PUPPET_GEM_VERSION: ${{ matrix.puppet_version }}
18-
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 }}
1921

2022
steps:
2123
- name: "Checkout"
@@ -24,28 +26,21 @@ jobs:
2426
- name: "Setup ruby"
2527
uses: "ruby/setup-ruby@v1"
2628
with:
27-
ruby-version: ${{matrix.ruby_version}}
29+
ruby-version: "2.7"
2830
bundler-cache: true
2931

30-
- name: "Bundle environment"
31-
run: |
32-
bundle env
33-
34-
- name: "Run Static & Syntax Tests"
32+
- name: Setup Test Matrix
33+
id: get-matrix
3534
run: |
36-
bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
37-
38-
- name: "Run tests"
39-
run: |
40-
bundle exec rake parallel_spec
35+
bundle exec matrix_from_metadata_v2 --provision-service
4136
4237
Acceptance:
4338
name: "Acceptance tests (${{matrix.platforms.label}}, ${{matrix.collection}})"
44-
needs: Spec
39+
needs: setup_matrix
4540
runs-on: ubuntu-latest
4641
strategy:
4742
fail-fast: false
48-
matrix: ${{ fromJson( vars.matrix ) }}
43+
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}
4944

5045
env:
5146
PUPPET_GEM_VERSION: '~> 7.24'

0 commit comments

Comments
 (0)