Skip to content

Commit 5ca9f30

Browse files
committed
update workflows
1 parent 0e70ac0 commit 5ca9f30

File tree

4 files changed

+153
-54
lines changed

4 files changed

+153
-54
lines changed

.github/workflows/linux.yml

+66-25
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
# brian's standard GitHub Actions Ubuntu config for Perl 5 modules
2-
# version 20230718.001
2+
# version 20250101.001
33
# https://github.com/briandfoy/github_workflows
44
# https://github.com/features/actions
55
# This file is licensed under the Artistic License 2.0
6+
#
7+
# This uses the AUTOMATED_TESTING environment that you can set up
8+
# in your repo settings. Or not. It still works if it isn't defined.
9+
# In that environment, add whatever environment variables or secrets
10+
# that you want.
11+
---
612
name: ubuntu
713

14+
# https://github.com/actions/checkout/issues/1590
15+
env:
16+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
17+
18+
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-concurrency
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
21+
cancel-in-progress: true
22+
823
on:
924
push:
1025
branches:
@@ -32,29 +47,35 @@ on:
3247
- 'Changes'
3348
- 'LICENSE'
3449
- 'README.pod'
35-
pull_request:
36-
50+
- 'README.md'
51+
- 'SECURITY.md'
52+
pull_request:
53+
# weekly build on the master branch just to see what CPAN is doing
54+
schedule:
55+
- cron: "37 3 * * 0"
3756
jobs:
3857
perl:
58+
environment: automated_testing
3959
runs-on: ${{ matrix.os }}
4060
strategy:
41-
matrix:
42-
os:
43-
- ubuntu-22.04
44-
perl-version:
45-
- '5.14'
46-
- '5.16'
47-
- '5.18'
48-
- '5.20'
49-
- '5.22'
50-
- '5.24'
51-
- '5.26'
52-
- '5.28'
53-
- '5.30'
54-
- '5.32'
55-
- '5.34'
56-
- '5.36'
57-
- 'latest'
61+
matrix:
62+
os:
63+
- ubuntu-22.04
64+
perl-version:
65+
- '5.14-buster'
66+
- '5.16-buster'
67+
- '5.18-buster'
68+
- '5.20-buster'
69+
- '5.22-buster'
70+
- '5.24-buster'
71+
- '5.26-buster'
72+
- '5.28-buster'
73+
- '5.30-bullseye'
74+
- '5.32-bullseye'
75+
- '5.34-bullseye'
76+
- '5.36-bookworm'
77+
- '5.38-bookworm'
78+
- 'latest'
5879
container:
5980
image: perl:${{ matrix.perl-version }}
6081
steps:
@@ -70,6 +91,26 @@ jobs:
7091
- name: Setup environment
7192
run: |
7293
echo "PERL_LWP_SSL_VERIFY_HOSTNAME=0" >> $GITHUB_ENV
94+
# HTML::Tagset bumped its minimum version to v5.10 for no good reason
95+
# but this is a prereq to LWP, which runs on v5.8. To get around this,
96+
# download the tarball and fix it for v5.8. Install it before we try
97+
# to install things that depend on it. More recent versions will
98+
# install it normally.
99+
# 1. remove the META files which have references to v5.10 and ignore
100+
# the warnings
101+
# 2. fix Makefile.PL to remove two references to v5.10
102+
# https://github.com/libwww-perl/HTML-Tagset/pull/14
103+
- name: fix html-tagset for v5.8
104+
if: env.PERL_VERSION == 'v5.8'
105+
run: |
106+
curl -L -O https://cpan.metacpan.org/authors/id/P/PE/PETDANCE/HTML-Tagset-3.24.tar.gz
107+
tar -xzf HTML-Tagset-3.24.tar.gz
108+
cd HTML-Tagset-3.24
109+
rm META.*
110+
mv Makefile.PL Makefile.PL.orig
111+
perl -n -e 'next if /(^use 5)|(MIN_PERL)/; print' Makefile.PL.orig > Makefile.PL
112+
cpan -T .
113+
cd ..
73114
# I had some problems with openssl on Ubuntu, so I punted by installing
74115
# cpanm first, which is easy. I can install IO::Socket::SSL with that,
75116
# then switch back to cpan. I didn't explore this further, but what you
@@ -78,17 +119,17 @@ jobs:
78119
- name: Install cpanm and multiple modules
79120
run: |
80121
curl -L https://cpanmin.us | perl - App::cpanminus
81-
cpanm --notest IO::Socket::SSL App::Cpan HTTP::Tiny ExtUtils::MakeMaker Test::Manifest Test::More
122+
cpanm --notest IO::Socket::SSL LWP::Protocol::https App::Cpan HTTP::Tiny ExtUtils::MakeMaker Test::Manifest Test::More
82123
# Install the dependencies, again not testing them. This installs the
83124
# module in the current directory, so we end up installing the module,
84125
# but that's not a big deal.
85126
- name: Install dependencies
86127
run: |
87-
cpanm --notest --installdeps --with-suggests --with-recommends .
128+
cpanm --notest --installdeps --with-suggests --with-recommends . ${{ vars.EXTRA_CPAN_MODULES }}
88129
- name: Show cpanm failures
89-
if: ${{ failure() }}
130+
if: ${{ failure() }}
90131
run: |
91-
cat /home/runner/.cpanm/work/*/build.log
132+
cat /github/home/.cpanm/work/*/build.log
92133
- name: Run tests
93134
run: |
94135
perl Makefile.PL
@@ -124,7 +165,7 @@ jobs:
124165
- name: Run coverage tests
125166
if: env.PERL_VERSION != 'v5.8' && env.PERL_VERSION != 'v5.10'
126167
env:
127-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
168+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128169
run: |
129170
cpanm --notest Devel::Cover Devel::Cover::Report::Coveralls
130171
perl Makefile.PL

.github/workflows/macos.yml

+23-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
# brian's standard GitHub Actions macOS config for Perl 5 modules
2-
# version 20220902.001
2+
# version 20250101.001
33
# https://github.com/briandfoy/github_workflows
44
# https://github.com/features/actions
55
# This file is licensed under the Artistic License 2.0
6+
#
7+
# This uses the AUTOMATED_TESTING environment that you can set up
8+
# in your repo settings. Or not. It still works if it isn't defined.
9+
# In that environment, add whatever environment variables or secrets
10+
# that you want.
11+
---
612
name: macos
713

14+
# https://github.com/actions/checkout/issues/1590
15+
env:
16+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
17+
18+
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-concurrency
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
21+
cancel-in-progress: true
22+
823
on:
924
push:
1025
branches:
@@ -32,10 +47,13 @@ on:
3247
- 'Changes'
3348
- 'LICENSE'
3449
- 'README.pod'
35-
pull_request:
50+
- 'README.md'
51+
- 'SECURITY.md'
52+
pull_request:
3653

3754
jobs:
3855
perl:
56+
environment: automated_testing
3957
runs-on: macOS-latest
4058
steps:
4159
- uses: actions/checkout@v3
@@ -44,7 +62,7 @@ jobs:
4462
- name: Set up Perl
4563
run: |
4664
brew install perl
47-
ls -d /usr/local/Cellar/perl/*/bin | head -1 >> $GITHUB_PATH
65+
ls -d /opt/homebrew/Cellar/perl/*/bin | head -1 >> $GITHUB_PATH
4866
perl -v | perl -0777 -ne 'm/(v5\.\d+)/ && print "PERL_VERSION=$1"' >> $GITHUB_ENV
4967
- name: Perl version check
5068
run: perl -V
@@ -67,7 +85,7 @@ jobs:
6785
# but that's not a big deal.
6886
- name: Install dependencies
6987
run: |
70-
cpan -M https://www.cpan.org -T .
88+
cpan -M https://www.cpan.org -T . ${{ vars.EXTRA_CPAN_MODULES }}
7189
- name: Run tests
7290
run: |
7391
perl Makefile.PL
@@ -102,7 +120,7 @@ jobs:
102120
- name: Run coverage tests
103121
if: env.PERL_VERSION != 'v5.8'
104122
env:
105-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
106124
run: |
107125
cpan -M https://www.cpan.org -T Devel::Cover Devel::Cover::Report::Coveralls
108126
perl Makefile.PL

.github/workflows/release.yml

+34-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# brian's standard GitHub Actions release config for Perl 5 modules
2-
# version 20230604.001
2+
# version 20241118.001
33
# https://github.com/briandfoy/github_workflows
44
# https://github.com/features/actions
55
# This file is licensed under the Artistic License 2.0
@@ -12,10 +12,17 @@
1212
# This requires that you configure a repository secret named
1313
# RELEASE_ACTION_TOKEN with a GitHub Personal Access Token
1414
# that has "read and write" permissions on Repository/Contents
15+
---
1516
name: release
1617

18+
# https://github.com/actions/checkout/issues/1590
19+
env:
20+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
21+
1722
permissions:
1823
contents: write
24+
id-token: write
25+
attestations: write
1926

2027
on:
2128
push:
@@ -40,11 +47,11 @@ jobs:
4047
environment: release
4148
runs-on: ${{ matrix.os }}
4249
strategy:
43-
matrix:
44-
os:
45-
- ubuntu-20.04
46-
perl-version:
47-
- 'latest'
50+
matrix:
51+
os:
52+
- ubuntu-20.04
53+
perl-version:
54+
- 'latest'
4855
container:
4956
image: perl:${{ matrix.perl-version }}
5057
steps:
@@ -73,7 +80,7 @@ jobs:
7380
# but that's not a big deal.
7481
- name: Install dependencies
7582
run: |
76-
cpanm --notest --installdeps --with-suggests --with-recommends .
83+
cpanm --notest --installdeps --with-suggests --with-recommends . ${{ vars.EXTRA_CPAN_MODULES }}
7784
# This makes the distribution and tests it, but assumes by the time we
7885
# got here, everything else was already tested.
7986
- name: Create distro
@@ -87,15 +94,28 @@ jobs:
8794
id: version
8895
- name: Changes extract
8996
run: |
90-
perl -00 -lne 'next unless /\A\d+\.\d+(_\d+)?/; print; last' Changes > Changes-latest
97+
perl -00 -lne 'next unless /\A\d+\.\d+(_\d+)?/; s/^\h+([*-])/$1/gm; s/^-/ -/gm; print; last' Changes > Changes-latest
9198
cat Changes-latest
9299
id: extract
100+
# https://cli.github.com/manual/gh_attestation_verify
101+
# DISTRO_FILE is the .tar.gz in the release
102+
# GITHUB_ACCOUNT is the github name of the releaser
103+
# gh auth login
104+
# gh attestation verify DISTRO_FILE --owner GITHUB_ACCOUNT
105+
- name: Generate artifact attestation
106+
id: attestation
107+
uses: actions/attest-build-provenance@v1
108+
with:
109+
subject-path: ${{ env.ASSET_NAME }}
93110
- name: upload
94111
uses: softprops/action-gh-release@v1
95112
with:
96-
body_path: Changes-latest
97-
draft: false
98-
prerelease: false
99-
name: ${{ steps.version.outputs.name }}
100-
files: "*.tar.gz"
101-
token: ${{ secrets.RELEASE_ACTION_TOKEN }}
113+
body_path: Changes-latest
114+
draft: false
115+
prerelease: false
116+
name: ${{ steps.version.outputs.name }}
117+
files: |
118+
${{ env.ASSET_NAME }}
119+
${{ steps.attestation.outputs.bundle-path }}
120+
${{ vars.EXTRA_RELEASE_PATHS }}
121+
token: ${{ secrets.RELEASE_ACTION_TOKEN }}

.github/workflows/windows.yml

+30-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
# brian's standard GitHub Actions Windows config for Perl 5 modules
2-
# version 20220902.001
2+
# version 20250101.001
33
# https://github.com/briandfoy/github_workflows
44
# https://github.com/features/actions
55
# This file is licensed under the Artistic License 2.0
6+
#
7+
# This uses the AUTOMATED_TESTING environment that you can set up
8+
# in your repo settings. Or not. It still works if it isn't defined.
9+
# In that environment, add whatever environment variables or secrets
10+
# that you want.
11+
---
612
name: windows
713

14+
# https://github.com/actions/checkout/issues/1590
15+
env:
16+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
17+
18+
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-concurrency
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
21+
cancel-in-progress: true
22+
823
on:
924
push:
1025
branches:
@@ -32,17 +47,20 @@ on:
3247
- 'Changes'
3348
- 'LICENSE'
3449
- 'README.pod'
35-
pull_request:
50+
- 'README.md'
51+
- 'SECURITY.md'
52+
pull_request:
3653

3754
jobs:
3855
perl:
56+
environment: automated_testing
3957
runs-on: ${{ matrix.os }}
4058
# store any secrets in an environment named "testing"
4159
strategy:
42-
matrix:
43-
os:
44-
- windows-2019
45-
- windows-2022
60+
matrix:
61+
os:
62+
- windows-2019
63+
- windows-2022
4664
steps:
4765
- run: git config --global core.autocrlf false
4866
- uses: actions/checkout@v3
@@ -60,7 +78,7 @@ jobs:
6078
- name: Install dependencies
6179
run: |
6280
cpan -M https://www.cpan.org -T .
63-
cpan -M https://www.cpan.org -T Test::Manifest
81+
cpan -M https://www.cpan.org -T Test::Manifest ${{ vars.EXTRA_CPAN_MODULES }}
6482
- name: Run tests
6583
run: |
6684
perl Makefile.PL
@@ -78,7 +96,7 @@ jobs:
7896
# stuff in parallel.
7997
- name: Run tests in parallel
8098
env:
81-
HARNESS_OPTIONS: j10
99+
HARNESS_OPTIONS: j10
82100
run: |
83101
perl Makefile.PL
84102
make test
@@ -92,10 +110,12 @@ jobs:
92110
perl Makefile.PL
93111
make disttest
94112
make clean
95-
# And, coverage reports
113+
# And, coverage reports. Windows Devel::Coverage can't handle threads,
114+
# so set the env var WINDOWS_SKIP_COVERAGE to skip this part.
96115
- name: Run coverage tests
116+
if: env.WINDOWS_SKIP_COVERAGE != 0
97117
env:
98-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99119
run: |
100120
cpan -M https://www.cpan.org -T Devel::Cover Devel::Cover::Report::Coveralls
101121
perl Makefile.PL

0 commit comments

Comments
 (0)