From fa3407a06d57faedfb3d50b91875d5c6bb6869ad Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 24 Jun 2024 17:32:00 +1000 Subject: [PATCH] bump lint and unit test to use matrix --- .github/workflows/acceptance_test.yml | 1 - .github/workflows/lint.yaml | 11 ++++++++--- .github/workflows/unit_tests.yml | 13 +++++++------ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/acceptance_test.yml b/.github/workflows/acceptance_test.yml index e69aa60..0d89037 100644 --- a/.github/workflows/acceptance_test.yml +++ b/.github/workflows/acceptance_test.yml @@ -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: diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index ae8e055..0324f8b 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -5,6 +5,9 @@ on: pull_request: branches: - "main" + push: + branches: + - "*" jobs: setup_matrix: @@ -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 != '{}' }} @@ -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: diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index f5327d1..6315bed 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -5,6 +5,9 @@ on: pull_request: branches: - "main" + push: + branches: + - "*" jobs: setup_matrix: @@ -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 != '{}' }} @@ -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: