Skip to content

Commit 8a0edf9

Browse files
simbabqueoalders
authored andcommitted
only install recommended modules on new enough Perls
We need to do this because IO::Compress::Brotli requires Perl 5.14, but we don't want to depend on that. So we've made it a recommended dependency, which we still want to install to run tests with on all Perls that allow it. But we need to explicitly not attempt to install it on Perls that are too old, because cpm cannot determine that a module's dependencies aren't met and ignore it.
1 parent cef9526 commit 8a0edf9

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/build-and-test.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ jobs:
5858
env:
5959
AUTHOR_TESTING: 1
6060
steps:
61+
- name: Decide if we need to install recommended modules
62+
id: with-recommends
63+
if: matrix.perl-version >= 5.14
64+
run: echo '::set-output name=flag::--with-recommends'
6165
- uses: actions/download-artifact@master
6266
with:
6367
name: build_dir
@@ -68,7 +72,7 @@ jobs:
6872
cpm install -g
6973
--cpanfile cpanfile
7074
--with-develop
71-
--with-recommends
75+
${{ steps.with-recommends.outputs.flag }}
7276
--with-suggests
7377
--show-build-log-on-failure
7478
- name: Run Tests
@@ -103,6 +107,10 @@ jobs:
103107
uses: shogo82148/actions-setup-perl@v1
104108
with:
105109
perl-version: ${{ matrix.perl-version }}
110+
- name: Decide if we need to install recommended modules
111+
id: with-recommends
112+
if: matrix.perl-version >= 5.14
113+
run: echo '::set-output name=flag::--with-recommends'
106114
- uses: actions/download-artifact@master
107115
with:
108116
name: build_dir
@@ -112,7 +120,13 @@ jobs:
112120
uses: perl-actions/install-with-cpm@v1
113121
with:
114122
cpanfile: "cpanfile"
115-
args: "--with-develop --with-recommends --with-suggests --with-test --mirror https://cpan.metacpan.org --mirror http://cpan.cpantesters.org"
123+
args: >
124+
--with-develop
125+
${{ steps.with-recommends.outputs.flag }}
126+
--with-suggests
127+
--with-test
128+
--mirror https://cpan.metacpan.org
129+
--mirror http://cpan.cpantesters.org
116130
- run: prove -l t xt
117131
env:
118132
AUTHOR_TESTING: 1

0 commit comments

Comments
 (0)