From 99c7190749856d7286834dc792cf62de1647828d Mon Sep 17 00:00:00 2001 From: Sven Willenbuecher Date: Mon, 23 Sep 2024 11:16:28 +0200 Subject: [PATCH 1/7] add new step "Identify installer" --- .github/workflows/cpan-test.yml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cpan-test.yml b/.github/workflows/cpan-test.yml index 169ed70..27eb1d5 100644 --- a/.github/workflows/cpan-test.yml +++ b/.github/workflows/cpan-test.yml @@ -32,18 +32,32 @@ jobs: run: perl -V - name: Install modules run: cpanm --notest --with-configure --with-develop --no-man-pages --installdeps . - - name: Configure with Build.PL - if: ${{ hashFiles('Build.PL') != '' }} + - name: Identify installer + id: installer-selector run: | - perl Build.PL - ./Build + if [ -f Makefile.PL ]; then + printf '%s\n' 'INSTALLER=EUMM' >> "${GITHUB_OUTPUT}" + elif [ -f Build.PL ]; then + printf '%s\n' 'INSTALLER=MB' >> "${GITHUB_OUTPUT}" + fi - name: Configure with Makefile.PL - if: ${{ hashFiles('Makefile.PL') != '' }} + if: ${{ steps.installer-selector.outputs.INSTALLER == 'EUMM' }} run: | perl Makefile.PL make - - name: Run tests - run: prove --blib --verbose t + - name: Configure with Build.PL + if: ${{ steps.installer-selector.outputs.INSTALLER == 'MB'}} + run: | + perl Build.PL + ./Build + - name: Run tests with make + if: ${{ steps.installer-selector.outputs.INSTALLER == 'EUMM' }} + run : | + make TEST_VERBOS=1 test + - name: Run tests with ./Build + if: ${{ steps.installer-selector.outputs.INSTALLER == 'MB' }} + run : | + ./Build verbose=1 test - name: Archive CPAN logs on Windows if: ${{ failure() && matrix.os == 'windows-latest' }} uses: actions/upload-artifact@v4 From b5ddd9d9c51a93a2d2703b98feedee2722c5aed1 Mon Sep 17 00:00:00 2001 From: Sven Willenbuecher Date: Mon, 23 Sep 2024 12:07:38 +0200 Subject: [PATCH 2/7] remove new step because it isn't portable --- .github/workflows/cpan-test.yml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cpan-test.yml b/.github/workflows/cpan-test.yml index 27eb1d5..94d2a2e 100644 --- a/.github/workflows/cpan-test.yml +++ b/.github/workflows/cpan-test.yml @@ -32,30 +32,24 @@ jobs: run: perl -V - name: Install modules run: cpanm --notest --with-configure --with-develop --no-man-pages --installdeps . - - name: Identify installer - id: installer-selector - run: | - if [ -f Makefile.PL ]; then - printf '%s\n' 'INSTALLER=EUMM' >> "${GITHUB_OUTPUT}" - elif [ -f Build.PL ]; then - printf '%s\n' 'INSTALLER=MB' >> "${GITHUB_OUTPUT}" - fi - name: Configure with Makefile.PL - if: ${{ steps.installer-selector.outputs.INSTALLER == 'EUMM' }} + id: configure-with-eumm + if: ${{ hashFiles('Makefile.PL') != '' }} run: | perl Makefile.PL make - name: Configure with Build.PL - if: ${{ steps.installer-selector.outputs.INSTALLER == 'MB'}} + id: configure-with-mb + if: ${{ hashFiles('Build.PL') != '' }} run: | perl Build.PL ./Build - name: Run tests with make - if: ${{ steps.installer-selector.outputs.INSTALLER == 'EUMM' }} + if: steps.configure-with-eumm.outcome == 'success' run : | - make TEST_VERBOS=1 test + make TEST_VERBOSE=1 test - name: Run tests with ./Build - if: ${{ steps.installer-selector.outputs.INSTALLER == 'MB' }} + if: steps.configure-with-mb.outcome == 'success' run : | ./Build verbose=1 test - name: Archive CPAN logs on Windows From 5f663f1691542f27f414ae53a78ac34384a9ce69 Mon Sep 17 00:00:00 2001 From: Sven Willenbuecher Date: Mon, 23 Sep 2024 15:19:05 +0200 Subject: [PATCH 3/7] add "Set testing context" step --- .github/workflows/cpan-test.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/cpan-test.yml b/.github/workflows/cpan-test.yml index 94d2a2e..2320c87 100644 --- a/.github/workflows/cpan-test.yml +++ b/.github/workflows/cpan-test.yml @@ -13,6 +13,10 @@ on: required: false type: string default: "['windows-latest', 'macos-latest', 'ubuntu-latest']" + testing_contexts: + required: false + type: string + default: '[ ]' jobs: testing: @@ -44,6 +48,16 @@ jobs: run: | perl Build.PL ./Build + - name: Set testing contexts + - name: Set testing context + if: "!startsWith(matrix.os, 'windows')" + run: | + printf '%s\n' '${{ inputs.testing_contexts }}' | \ + jq -r '.[]' | \ + tr '[:lower:]' '[:upper:]' | \ + while read -r item; do + printf '%s_TESTING=1\n' "${item}" >> "${GITHUB_ENV}" + done - name: Run tests with make if: steps.configure-with-eumm.outcome == 'success' run : | From 30600506c631dd54a1eda5524872540faa61e55e Mon Sep 17 00:00:00 2001 From: Sven Willenbuecher Date: Mon, 23 Sep 2024 15:25:50 +0200 Subject: [PATCH 4/7] use singular term --- .github/workflows/cpan-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpan-test.yml b/.github/workflows/cpan-test.yml index 2320c87..f1dfbf5 100644 --- a/.github/workflows/cpan-test.yml +++ b/.github/workflows/cpan-test.yml @@ -13,7 +13,7 @@ on: required: false type: string default: "['windows-latest', 'macos-latest', 'ubuntu-latest']" - testing_contexts: + testing_context: required: false type: string default: '[ ]' @@ -52,7 +52,7 @@ jobs: - name: Set testing context if: "!startsWith(matrix.os, 'windows')" run: | - printf '%s\n' '${{ inputs.testing_contexts }}' | \ + printf '%s\n' '${{ inputs.testing_context }}' | \ jq -r '.[]' | \ tr '[:lower:]' '[:upper:]' | \ while read -r item; do From e551e19380c674a1fd87697f310c5b60998ea3c9 Mon Sep 17 00:00:00 2001 From: Sven Willenbuecher Date: Mon, 23 Sep 2024 15:36:02 +0200 Subject: [PATCH 5/7] use double quotes --- .github/workflows/cpan-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpan-test.yml b/.github/workflows/cpan-test.yml index f1dfbf5..f965116 100644 --- a/.github/workflows/cpan-test.yml +++ b/.github/workflows/cpan-test.yml @@ -52,7 +52,7 @@ jobs: - name: Set testing context if: "!startsWith(matrix.os, 'windows')" run: | - printf '%s\n' '${{ inputs.testing_context }}' | \ + printf '%s\n' "${{ inputs.testing_context }}" | \ jq -r '.[]' | \ tr '[:lower:]' '[:upper:]' | \ while read -r item; do From 69f76a54a81829ecb206707bd89329b358fc7d5b Mon Sep 17 00:00:00 2001 From: Sven Willenbuecher Date: Mon, 23 Sep 2024 15:52:39 +0200 Subject: [PATCH 6/7] translate quotes --- .github/workflows/cpan-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cpan-test.yml b/.github/workflows/cpan-test.yml index f965116..f500203 100644 --- a/.github/workflows/cpan-test.yml +++ b/.github/workflows/cpan-test.yml @@ -53,6 +53,7 @@ jobs: if: "!startsWith(matrix.os, 'windows')" run: | printf '%s\n' "${{ inputs.testing_context }}" | \ + tr "'" '"' | \ jq -r '.[]' | \ tr '[:lower:]' '[:upper:]' | \ while read -r item; do From b3cd3c0dabd73014f6d310c6d49f42323b44e265 Mon Sep 17 00:00:00 2001 From: Sven Willenbuecher Date: Mon, 23 Sep 2024 15:59:19 +0200 Subject: [PATCH 7/7] fix JSON array of strings use double quotes --- .github/workflows/cpan-test.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cpan-test.yml b/.github/workflows/cpan-test.yml index f500203..3708acd 100644 --- a/.github/workflows/cpan-test.yml +++ b/.github/workflows/cpan-test.yml @@ -8,11 +8,11 @@ on: perl_version: required: false type: string - default: "['5.24', '5.26', '5.28', '5.30', '5.32', '5.34', '5.36', '5.38']" + default: '["5.24", "5.26", "5.28", "5.30", "5.32", "5.34", "5.36", "5.38"]' os: required: false type: string - default: "['windows-latest', 'macos-latest', 'ubuntu-latest']" + default: '["windows-latest", "macos-latest", "ubuntu-latest"]' testing_context: required: false type: string @@ -52,8 +52,7 @@ jobs: - name: Set testing context if: "!startsWith(matrix.os, 'windows')" run: | - printf '%s\n' "${{ inputs.testing_context }}" | \ - tr "'" '"' | \ + printf '%s\n' '${{ inputs.testing_context }}' | \ jq -r '.[]' | \ tr '[:lower:]' '[:upper:]' | \ while read -r item; do