diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..a4ffe29 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,106 @@ +name: "Check Workflow" + +on: [push, pull_request] + +jobs: + + perl-versions: + runs-on: ubuntu-latest + name: 'perl-versions default' + outputs: + perl-versions: ${{ steps.action.outputs.perl-versions }} + steps: + - uses: actions/checkout@v4 + - name: "uses perl-versions" + id: action + uses: ./ + + since-v520: + runs-on: ubuntu-latest + name: 'since v5.20' + outputs: + perl-versions: ${{ steps.action.outputs.perl-versions }} + steps: + - uses: actions/checkout@v4 + - name: "uses perl-versions" + id: action + uses: ./ + with: + since-perl: v5.20 + + since-520: + runs-on: ubuntu-latest + name: 'since 5.20' + outputs: + perl-versions: ${{ steps.action.outputs.perl-versions }} + steps: + - uses: actions/checkout@v4 + - name: "uses perl-versions" + id: action + uses: ./ + with: + since-perl: "5.20" + + since-536-with-devel: + runs-on: ubuntu-latest + name: 'since 5.36 with devel' + outputs: + perl-versions: ${{ steps.action.outputs.perl-versions }} + steps: + - uses: actions/checkout@v4 + - name: "uses perl-versions" + id: action + uses: ./ + with: + since-perl: 5.36 + with-devel: true + + test-matrix: + runs-on: ubuntu-latest + needs: + - since-536-with-devel + strategy: + fail-fast: false + matrix: + perl-versions: ${{ fromJson (needs.since-536-with-devel.outputs.perl-versions) }} + steps: + - run: echo "Hello" + + perl-tester: + runs-on: ubuntu-latest + needs: + - since-536-with-devel + name: "Perl ${{ matrix.perl-version }}" + strategy: + fail-fast: false + matrix: + perl-version: ${{ fromJson (needs.since-536-with-devel.outputs.perl-versions) }} + container: + image: perldocker/perl-tester:${{ matrix.perl-version }} + steps: + - uses: actions/checkout@v4 + - run: perl -V + + check: + needs: + - perl-versions + - since-v520 + - since-520 + - since-536-with-devel + runs-on: ubuntu-latest + steps: + - name: "Testing perl-versions" + run: | + [[ '${{ needs.perl-versions.outputs.perl-versions }}' == '["5.14","5.16","5.18","5.20","5.22","5.24","5.26","5.28","5.30","5.32","5.34","5.36","5.38"]' ]] && echo "ok" + + - name: "Testing since-v520" + run: | + [[ '${{ needs.since-v520.outputs.perl-versions }}' == '["5.20","5.22","5.24","5.26","5.28","5.30","5.32","5.34","5.36","5.38"]' ]] && echo "ok" + + - name: "Testing since-520" + run: | + [[ '${{ needs.since-520.outputs.perl-versions }}' == '["5.20","5.22","5.24","5.26","5.28","5.30","5.32","5.34","5.36","5.38"]' ]] && echo "ok" + + - name: "Testing since-536-with-devel" + run: | + [[ '${{ needs.since-536-with-devel.outputs.perl-versions }}' == '["5.36","5.38","devel"]' ]] && echo "ok" diff --git a/README.md b/README.md index d0ee471..ac9e96e 100644 --- a/README.md +++ b/README.md @@ -29,22 +29,31 @@ if available. jobs: perl-versions: runs-on: ubuntu-latest - name: List perl versions + name: List Perl versions outputs: perl-versions: ${{ steps.action.outputs.perl-versions }} steps: - - name: Perl versions action step - id: action + - id: action uses: perl-actions/perl-versions@v1 with: since-perl: v5.20 + ## + ## Using perl-versions with perl-tester + ## test: needs: - perl-versions + name: "Perl ${{ matrix.perl-version }}" strategy: + fail-fast: false matrix: perl-versions: ${{ fromJson (needs.perl-versions.outputs.perl-versions) }} + container: + image: perldocker/perl-tester:${{ matrix.perl-version }} + steps: + - uses: actions/checkout@v4 + - run: perl -V ``` @@ -71,7 +80,7 @@ jobs: perl-versions: uses: perl-actions/perl-versions@v1 with: - since-perl: 5.14 + since-perl: "5.14" test: needs: