Skip to content

Commit

Permalink
bump lint and unit test to use matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-robertson committed Jun 24, 2024
1 parent a04d6c7 commit fa3407a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
1 change: 0 additions & 1 deletion .github/workflows/acceptance_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ jobs:
id: get-matrix
run: |
echo "matrix=$(cat test_matrix.json | tr -s '\n' ' ')" >> $GITHUB_OUTPUT
# echo "matrix={'platform':['centos-stream8'],'collection':['puppet7', 'puppet8'],'gem_version':['~> 7.31', '~> 8.7']}" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
acceptance:
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
pull_request:
branches:
- "main"
push:
branches:
- "*"

jobs:
setup_matrix:
Expand Down Expand Up @@ -35,9 +38,11 @@ jobs:
- name: Setup Integration Test Matrix
id: get-matrix
run: |
echo "matrix={'platform':['centos-stream8'],'collection':['puppet7-nightly', 'puppet8-nightly']}" >> $GITHUB_OUTPUT
echo "matrix=$(cat test_matrix.json | tr -s '\n' ' ')" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
Unit:
lint:
name: "Lint tests (${{matrix.collection.agent_version}})"
needs:
- setup_matrix
if: ${{ needs.setup_matrix.outputs.matrix != '{}' }}
Expand All @@ -48,7 +53,7 @@ jobs:
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}

env:
PUPPET_GEM_VERSION: '~> 8.7'
PUPPET_GEM_VERSION: ${{matrix.collection.gem_version}}
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' # why is this set?

steps:
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
pull_request:
branches:
- "main"
push:
branches:
- "*"

jobs:
setup_matrix:
Expand Down Expand Up @@ -35,13 +38,11 @@ jobs:
- name: Setup Integration Test Matrix
id: get-matrix
run: |
if [ '${{ github.repository_owner }}' == 'benjamin-robertson' ]; then
echo "matrix={'platform':['centos-stream8'],'collection':['puppet7-nightly', 'puppet8-nightly']}" >> $GITHUB_OUTPUT
else
echo "matrix={}" >> $GITHUB_OUTPUT
fi
echo "matrix=$(cat test_matrix.json | tr -s '\n' ' ')" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
Unit:
name: "Unit tests (${{matrix.collection.agent_version}})"
needs:
- setup_matrix
if: ${{ needs.setup_matrix.outputs.matrix != '{}' }}
Expand All @@ -52,7 +53,7 @@ jobs:
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}

env:
PUPPET_GEM_VERSION: '~> 8.7'
PUPPET_GEM_VERSION: ${{matrix.collection.gem_version}}
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' # why is this set?

steps:
Expand Down

0 comments on commit fa3407a

Please sign in to comment.