Skip to content

Commit

Permalink
Use perl-actions/perl-versions to build perl-versions matrix
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
happy-barney committed Nov 7, 2023
1 parent e6f2ca8 commit 4f72963
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 36 deletions.
33 changes: 15 additions & 18 deletions .github/workflows/publish-to-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -29,28 +41,13 @@ jobs:
build:
name: "Build versions"
runs-on: ubuntu-latest
needs:
- prepare-matrix

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
Expand Down
32 changes: 14 additions & 18 deletions .github/workflows/test-cpanfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,27 @@ 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:
image: perl:${{ matrix.perl-version }}-buster
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
Expand Down

0 comments on commit 4f72963

Please sign in to comment.