Skip to content

Commit 61ff76c

Browse files
committed
Update GitHub workflows
1 parent 3dd727d commit 61ff76c

File tree

3 files changed

+183
-15
lines changed

3 files changed

+183
-15
lines changed

.github/workflows/linux.yml

Lines changed: 64 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
1+
# brian's standard GitHub Actions Ubuntu config for Perl 5 modules
2+
# https://github.com/briandfoy/github_actions
3+
# https://github.com/features/actions
4+
# This file is licensed under the Artistic License 2.0
15
name: ubuntu
26

37
on:
48
push:
59
branches:
6-
- '*'
10+
- '**'
11+
- '!**windows**'
12+
- '!**macos**'
713
tags-ignore:
8-
- '*'
14+
# I tag release pushes but those should have already been tested
15+
- 'release-*'
16+
paths-ignore:
17+
# list all the files which are irrelevant to the tests
18+
# non-code, support files, docs, etc
19+
- '.appveyor.yml'
20+
- '.github/workflows/macos.yml'
21+
- '.github/workflows/windows.yml'
22+
- '.gitignore'
23+
- '.releaserc'
24+
- 'Changes'
25+
- 'LICENSE'
26+
- 'README.pod'
927
pull_request:
1028

1129
jobs:
@@ -38,17 +56,58 @@ jobs:
3856
- name: Platform check
3957
run: uname -a
4058
- name: Perl version check
41-
run: perl -V
59+
run: |
60+
perl -V
61+
perl -v | perl -0777 -ne 'm/(v5\.\d+)/ && print "PERL_VERSION=$1"' >> $GITHUB_ENV
62+
# Some older versions of Perl have trouble with hostnames in certs. I
63+
# haven't figured out why.
64+
- name: Setup environment
65+
run: |
66+
echo "PERL_LWP_SSL_VERIFY_HOSTNAME=0" >> $GITHUB_ENV
67+
# I had some problems with openssl on Ubuntu, so I punted by installing
68+
# cpanm first, which is easy. I can install IO::Socket::SSL with that,
69+
# then switch back to cpan. I didn't explore this further, but what you
70+
# see here hasn't caused problems for me.
71+
# Need HTTP::Tiny 0.055 or later.
4272
- name: Install cpanm and multiple modules
4373
run: |
4474
curl -L https://cpanmin.us | perl - App::cpanminus
45-
cpanm --notest IO::Socket::SSL
46-
cpanm --notest App::Cpan
75+
cpanm --notest IO::Socket::SSL App::Cpan ExtUtils::MakeMaker HTTP::Tiny
4776
cpan -M https://www.cpan.org -T ExtUtils::MakeMaker
77+
# Install the dependencies, again not testing them. This installs the
78+
# module in the current directory, so we end up installing the module,
79+
# but that's not a big deal.
4880
- name: Install dependencies
4981
run: |
5082
cpan -M https://www.cpan.org -T .
5183
- name: Run tests
5284
run: |
5385
perl Makefile.PL
5486
make test
87+
# Running tests in parallel should be faster, but it's also more
88+
# tricky in cases where different tests share a feature, such as a
89+
# file they want to write to. Parallel tests can stomp on each other.
90+
# Test in parallel to catch that, because other people will test your
91+
# stuff in parallel.
92+
- name: Run tests in parallel
93+
run: |
94+
perl Makefile.PL
95+
HARNESS_OPTIONS=j10 make test
96+
# The disttest target creates the distribution, unwraps it, changes
97+
# into the dist dir, then runs the tests there. That checks that
98+
# everything that should be in the dist is in the dist. If you forget
99+
# to update MANIFEST with new modules, data files, and so on, you
100+
# should notice the error.
101+
- name: Run distribution tests
102+
run: |
103+
perl Makefile.PL
104+
make disttest
105+
# And, coverage reports, but only under 5.10 and later since modern
106+
# Devel::Cover instances don't work with 5.8
107+
- name: Run coverage tests
108+
if: env.PERL_VERSION != 'v5.8'
109+
env:
110+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111+
run: |
112+
cpan -M https://www.cpan.org -T Devel::Cover Devel::Cover::Report::Coveralls
113+
cover -test -report coveralls

.github/workflows/macos.yml

Lines changed: 65 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,93 @@
1+
# brian's standard GitHub Actions macOS config for Perl 5 modules
2+
# https://github.com/briandfoy/github_actions
3+
# https://github.com/features/actions
4+
# This file is licensed under the Artistic License 2.0
15
name: macos
26

37
on:
48
push:
59
branches:
6-
- '*'
10+
- '**'
11+
- '!**windows**'
12+
- '!**linux**'
713
tags-ignore:
8-
- '*'
14+
# I tag release pushes but those should have already been tested
15+
- 'release-*'
16+
paths-ignore:
17+
# list all the files which are irrelevant to the tests
18+
# non-code, support files, docs, etc
19+
- '.appveyor.yml'
20+
- '.github/workflows/ubuntu.yml'
21+
- '.github/workflows/windows.yml'
22+
- '.gitignore'
23+
- '.releaserc'
24+
- 'Changes'
25+
- 'LICENSE'
26+
- 'README.pod'
927
pull_request:
1028

1129
jobs:
1230
perl:
1331
runs-on: macOS-latest
14-
1532
steps:
1633
- uses: actions/checkout@v2
1734
- name: Platform check
1835
run: uname -a
1936
- name: Set up Perl
20-
run: brew install perl
37+
run: |
38+
brew install perl
39+
ls -d /usr/local/Cellar/perl/*/bin | head -1 >> $GITHUB_PATH
40+
perl -v | perl -0777 -ne 'm/(v5\.\d+)/ && print "PERL_VERSION=$1"' >> $GITHUB_ENV
2141
- name: Perl version check
2242
run: perl -V
43+
# cpan can operate with https, but we need IO::SSL::Socket, which
44+
# does not come with Perl.
45+
#
46+
# When using cpan, use -M to specify the CDN-backed www.cpan.org
47+
# mirror. I've noticed that letting CPAN.pm auto-choose mirrors
48+
# sometimes selects things that the action can't reach.
49+
#
50+
# Also, use the -T option to not test the dependencies. Assume these
51+
# mainline modules are good and save lots of CI minutes.
2352
- name: Prepare cpan
2453
run: |
2554
openssl version
26-
cpan -M https://www.cpan.org -T Net::SSLeay IO::Socket::SSL ExtUtils::MakeMaker
55+
cpan -M http://www.cpan.org -T IO::Socket::SSL LWP::Protocol::https
56+
cpan -M https://www.cpan.org -T ExtUtils::MakeMaker
57+
# Install the dependencies, again not testing them. This installs the
58+
# module in the current directory, so we end up installing the module,
59+
# but that's not a big deal.
2760
- name: Install dependencies
2861
run: |
2962
cpan -M https://www.cpan.org -T .
3063
- name: Run tests
3164
run: |
3265
perl Makefile.PL
3366
make test
67+
# Running tests in parallel should be faster, but it's also more
68+
# tricky in cases where different tests share a feature, such as a
69+
# file they want to write to. Parallel tests can stomp on each other.
70+
# Test in parallel to catch that, because other people will test your
71+
# stuff in parallel.
72+
- name: Run tests in parallel
73+
run: |
74+
perl Makefile.PL
75+
HARNESS_OPTIONS=j10 make test
76+
# The disttest target creates the distribution, unwraps it, changes
77+
# into the dist dir, then runs the tests there. That checks that
78+
# everything that should be in the dist is in the dist. If you forget
79+
# to update MANIFEST with new modules, data files, and so on, you
80+
# should notice the error.
81+
- name: Run distribution tests
82+
run: |
83+
perl Makefile.PL
84+
make disttest
85+
# And, coverage reports, but only under 5.10 and later since modern
86+
# Devel::Cover instances don't work with 5.8
87+
- name: Run coverage tests
88+
if: env.PERL_VERSION != 'v5.8'
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
run: |
92+
cpan -M https://www.cpan.org -T Devel::Cover Devel::Cover::Report::Coveralls
93+
cover -test -report coveralls

.github/workflows/windows.yml

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,40 @@
1+
# brian's standard GitHub Actions Windows config for Perl 5 modules
2+
# https://github.com/briandfoy/github_actions
3+
# https://github.com/features/actions
4+
# This file is licensed under the Artistic License 2.0
15
name: windows
26

37
on:
48
push:
59
branches:
6-
- '*'
10+
- '**'
11+
- '!**linux**'
12+
- '!**macos**'
713
tags-ignore:
8-
- '*'
14+
# I tag release pushes but those should have already been tested
15+
- 'release-*'
16+
paths-ignore:
17+
# list all the files which are irrelevant to the tests
18+
# non-code, support files, docs, etc
19+
- '.appveyor.yml'
20+
- '.github/workflows/macos.yml'
21+
- '.github/workflows/ubuntu.yml'
22+
- '.gitignore'
23+
- '.releaserc'
24+
- 'Changes'
25+
- 'LICENSE'
26+
- 'README.pod'
927
pull_request:
1028

1129
jobs:
1230
perl:
1331
runs-on: ${{ matrix.os }}
32+
# store any secrets in an environment named "testing"
1433
strategy:
1534
matrix:
1635
os:
17-
- windows-2019
1836
- windows-2016
19-
37+
- windows-2019
2038
steps:
2139
- uses: actions/checkout@v2
2240
- name: Set up Perl
@@ -27,9 +45,40 @@ jobs:
2745
echo "C:\strawberry\perl\bin" >> $GITHUB_PATH
2846
- name: Perl version
2947
run: perl -V
48+
# Install the dependencies, again not testing them. This installs the
49+
# module in the current directory, so we end up installing the module,
50+
# but that's not a big deal.
3051
- name: Install dependencies
31-
run: cpan -M https://www.cpan.org -T .
52+
run: |
53+
cpan -M https://www.cpan.org -T .
3254
- name: Run tests
3355
run: |
3456
perl Makefile.PL
3557
make test
58+
# Running tests in parallel should be faster, but it's also more
59+
# tricky in cases where different tests share a feature, such as a
60+
# file they want to write to. Parallel tests can stomp on each other.
61+
# Test in parallel to catch that, because other people will test your
62+
# stuff in parallel.
63+
- name: Run tests in parallel
64+
env:
65+
HARNESS_OPTIONS: j10
66+
run: |
67+
perl Makefile.PL
68+
make test
69+
# The disttest target creates the distribution, unwraps it, changes
70+
# into the dist dir, then runs the tests there. That checks that
71+
# everything that should be in the dist is in the dist. If you forget
72+
# to update MANIFEST with new modules, data files, and so on, you
73+
# should notice the error.
74+
- name: Run distribution tests
75+
run: |
76+
perl Makefile.PL
77+
make disttest
78+
# And, coverage reports
79+
- name: Run coverage tests
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
run: |
83+
cpan -M https://www.cpan.org -T Devel::Cover Devel::Cover::Report::Coveralls
84+
cover -test -report coveralls

0 commit comments

Comments
 (0)