Github action for your matrix to generate list of perls since given.
For list of available perl versions check docker-perl-tester.
Both since-perl and until-perl accept version numbers in the following formats:
| Format | Example | Description |
|---|---|---|
| Numeric | 5.20 |
Standard version number |
| V-prefixed | v5.20 |
Version with v prefix |
| Patch-level | 5.36.3 |
Patch component is ignored — treated as 5.36 |
latest |
latest |
Symbolic version — the newest stable Perl release |
Required parameter.
Returns perl versions since this (including).
When unknown version is provided, returns empty list.
Default: latest
Returns perl versions up to this version (including this version).
Can be combined with since-perl to get a specific range of versions.
Default: false
When set to true, returned list will also include current devel version of Perl,
if available.
jobs:
perl-versions:
runs-on: ubuntu-latest
name: List Perl versions
outputs:
perl-versions: ${{ steps.action.outputs.perl-versions }}
steps:
- id: action
uses: perl-actions/perl-versions@v2
with:
since-perl: 5.20
until-perl: 5.36
with-devel: false
##
## Combining perl-versions with perl-tester
##
test:
needs:
- perl-versions
name: "Perl ${{ matrix.perl-version }}"
strategy:
fail-fast: false
matrix:
perl-version: ${{ fromJson (needs.perl-versions.outputs.perl-versions) }}
container:
image: perldocker/perl-tester:${{ matrix.perl-version }}
steps:
- uses: actions/checkout@v4
- run: perl -V
# adjust that section to fit your distribution
- uses: perl-actions/ci-perl-tester-helpers/install-test-helper-deps@main
- uses: perl-actions/ci-perl-tester-helpers/cpan-install-build-deps@main
- uses: perl-actions/ci-perl-tester-helpers/build-dist@main
- uses: perl-actions/ci-perl-tester-helpers/cpan-install-dist-deps@main
- uses: perl-actions/ci-perl-tester-helpers/test-dist@main
env:
AUTHOR_TESTING: 1Use the latest symbolic version with since-perl to get only the newest stable
Perl (and optionally devel):
- id: action
uses: perl-actions/perl-versions@v2
with:
since-perl: latest
with-devel: true - id: action
uses: perl-actions/perl-versions@v2
with:
since-perl: 5.20Patch-level version numbers (e.g. 5.8.1, 5.36.3) are automatically truncated
to their major.minor series. This means since-perl: 5.8.1 is equivalent to
since-perl: 5.8 — the patch component is stripped before filtering.
- id: action
uses: perl-actions/perl-versions@v2
with:
since-perl: 5.8.1
until-perl: 5.14This returns ["5.8","5.10","5.12","5.14"] — the 5.8 series is included
despite the .1 patch suffix.
Here is an example to massage the Perl versions to append the string -buster to all 5.\d+ versions. (TIMTODY)
perl-versions:
runs-on: ubuntu-latest
name: List Perl versions
outputs:
perl-versions: ${{ steps.massage.outputs.perl-versions }}
steps:
- id: action
uses: perl-actions/perl-versions@v2
with:
since-perl: 5.10
with-devel: true
- id: massage
name: add buster
run: |
echo '${{ steps.action.outputs.perl-versions }}' > perl.versions
perl -pi -e 's/"(\d\.\d+)"/"$1-buster"/g' perl.versions
cat perl.versions
echo "perl-versions=$(cat perl.versions)" >> $GITHUB_OUTPUT