Skip to content

Commit cbb7b52

Browse files
committed
Update Macos.yml to auto-detect available Perl versions
1 parent a0ff9cb commit cbb7b52

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

.github/workflows/macos.yml

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,45 +8,45 @@ on:
88
- cron: '01 01 * * 6' # Run every Saturday
99

1010
jobs:
11-
build:
12-
11+
list:
12+
name: list available perl versions
1313
runs-on: macos-latest
14+
steps:
15+
- uses: shogo82148/actions-setup-perl@v1
16+
- id: set-matrix
17+
name: list available perl versions
18+
shell: perl {0}
19+
run: |
20+
use Actions::Core;
1421
15-
strategy:
16-
matrix:
17-
perl:
18-
# - 'develop'
19-
- '5.42'
20-
- '5.40'
21-
- '5.38'
22-
- '5.36'
23-
- '5.34'
24-
- '5.32'
25-
- '5.30'
26-
- '5.28'
27-
- '5.26'
28-
- '5.24'
29-
- '5.22'
30-
- '5.20'
31-
- '5.18'
32-
- '5.16'
33-
- '5.14'
34-
- '5.12'
35-
- '5.10'
36-
- '5.8'
22+
print "Version available\n";
23+
my @versions = perl_versions();
24+
for my $v (@versions) {
25+
print "\t$v\n";
26+
}
27+
# Don't want anything less then 5.8
28+
@versions = grep { ! /5\.6\.*/ } @versions;
29+
set_output(matrix => {perl => [@versions]});
30+
outputs:
31+
matrix: ${{ steps.set-matrix.outputs.matrix }}
3732

38-
name: Perl ${{ matrix.perl }}
33+
run:
34+
runs-on: macos-latest
35+
needs: list
36+
strategy:
37+
fail-fast: false
38+
matrix: ${{fromJson(needs.list.outputs.matrix)}}
3939
steps:
40-
- uses: actions/checkout@v6
41-
- name: Setup perl
42-
uses: shogo82148/actions-setup-perl@v1
43-
with:
44-
perl-version: ${{ matrix.perl }}
45-
- name: Perl version
46-
run: perl -V
47-
- name: Install dependencies
48-
run: cpanm --quiet --installdeps --notest .
49-
- name: Build
50-
run: perl Makefile.PL && make
51-
- name: Test
52-
run: make test
40+
- uses: actions/checkout@v6
41+
- name: Setup perl
42+
uses: shogo82148/actions-setup-perl@v1
43+
with:
44+
perl-version: ${{ matrix.perl }}
45+
- name: Perl version
46+
run: perl -V
47+
- name: Install dependencies
48+
run: cpanm --quiet --installdeps --notest .
49+
- name: Build
50+
run: perl Makefile.PL && make
51+
- name: Test
52+
run: make test

0 commit comments

Comments
 (0)