From 41d5a72ed351cab2805e3dbcf44df460ef6e07ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branislav=20Zahradn=C3=ADk?= Date: Tue, 7 Nov 2023 07:36:30 +0100 Subject: [PATCH] Use perl-actions/perl-versions to build perl-versions matrix to maintain single list of available perl versions Advantage - new versions will automatically spread Disadvantage: - there will be some delay between committing new version and new docker image available. --- .github/workflows/publish-to-docker.yml | 31 ++++++++++-------------- .github/workflows/test-cpanfile.yml | 32 +++++++++++-------------- 2 files changed, 27 insertions(+), 36 deletions(-) diff --git a/.github/workflows/publish-to-docker.yml b/.github/workflows/publish-to-docker.yml index 381244c..5351f27 100644 --- a/.github/workflows/publish-to-docker.yml +++ b/.github/workflows/publish-to-docker.yml @@ -10,6 +10,18 @@ on: workflow_dispatch: jobs: + prepare-matrix: + runs-on: ubuntu-latest + name: List perl versions + outputs: + perl-versions: ${{ steps.action.outputs.perl-versions }} + steps: + - name: Perl versions action step + id: action + uses: perl-actions/perl-versions@main + with: + since-perl: '5.8' + with-devel: 'true' latest-build: name: "Build latest" @@ -33,24 +45,7 @@ jobs: strategy: fail-fast: false matrix: - perl-version: - - "devel" - - "5.38" - - "5.36" - - "5.34" - - "5.32" - - "5.30" - - "5.28" - - "5.26" - - "5.24" - - "5.22" - - "5.20" - - "5.18" - - "5.16" - - "5.14" - - "5.12" - - "5.10" - - "5.8" + perl-version: ${{ fromJson (needs.prepare-matrix.outputs.perl-versions) }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test-cpanfile.yml b/.github/workflows/test-cpanfile.yml index ffd2215..f18a54f 100644 --- a/.github/workflows/test-cpanfile.yml +++ b/.github/workflows/test-cpanfile.yml @@ -7,6 +7,19 @@ on: - '*' workflow_dispatch: jobs: + prepare-matrix: + runs-on: ubuntu-latest + name: List perl versions + outputs: + perl-versions: ${{ steps.action.outputs.perl-versions }} + steps: + - name: Perl versions action step + id: action + uses: perl-actions/perl-versions@main + with: + since-perl: '5.8' + with-devel: 'true' + test-job: runs-on: ubuntu-latest container: @@ -14,24 +27,7 @@ jobs: strategy: fail-fast: false matrix: - perl-version: - - 'devel' - - '5.38' - - '5.36' - - '5.34' - - '5.32' - - '5.30' - - '5.28' - - '5.26' - - '5.24' - - '5.22' - - '5.20' - - '5.18' - - '5.16' - - '5.14' - - '5.12' - - '5.10' - - '5.8' + perl-version: ${{ fromJson (needs.prepare-matrix.outputs.perl-versions) }} name: Perl ${{ matrix.perl-version }} steps: - uses: actions/checkout@v4