Skip to content

Commit 2ae1646

Browse files
committed
Updated GitHub workflows from https://github.com/briandfoy/github_workflows
afbd46c5fb556b0886f70add936d6c35e7f67980 * �[92mlinux.yml�[0m upgraded: 20250126.002 -> 20250811.001 * �[92mmacos.yml�[0m upgraded: 20250125.002 -> 20250811.001 * �[92mrelease.yml�[0m upgraded: 20250226.001 -> 20250811.001 * �[92mwindows.yml�[0m upgraded: 20250126.001 -> 20250811.001
1 parent ab4f908 commit 2ae1646

File tree

4 files changed

+116
-33
lines changed

4 files changed

+116
-33
lines changed

.github/workflows/linux.yml

Lines changed: 63 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# brian's standard GitHub Actions Ubuntu config for Perl 5 modules
2-
# version 20250126.002
2+
# version 20250811.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
@@ -38,6 +38,10 @@ concurrency:
3838
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
3939
cancel-in-progress: true
4040

41+
permissions:
42+
actions: write
43+
contents: read
44+
4145
on:
4246
push:
4347
branches:
@@ -70,27 +74,16 @@ on:
7074
pull_request:
7175
# weekly build on the master branch just to see what CPAN is doing
7276
schedule:
73-
- cron: "37 3 * * 0"
77+
- cron: "34 4 * * 5"
7478
jobs:
7579
perl:
7680
environment: automated_testing
7781
runs-on: ${{ matrix.os }}
7882
strategy:
7983
matrix:
8084
os:
81-
- ubuntu-22.04
85+
- ubuntu-latest
8286
perl-version:
83-
- '5.8-buster'
84-
- '5.10-buster'
85-
- '5.12-buster'
86-
- '5.14-buster'
87-
- '5.16-buster'
88-
- '5.18-buster'
89-
- '5.20-buster'
90-
- '5.22-buster'
91-
- '5.24-buster'
92-
- '5.26-buster'
93-
- '5.28-buster'
9487
- '5.30-bullseye'
9588
- '5.32-bullseye'
9689
- '5.34-bullseye'
@@ -100,13 +93,28 @@ jobs:
10093
container:
10194
image: perl:${{ matrix.perl-version }}
10295
steps:
103-
- uses: actions/checkout@v3
96+
- uses: actions/checkout@v5
97+
- name: git corrections
98+
run: |
99+
git config --global --add safe.directory "$(pwd)"
104100
- name: Platform check
105101
run: uname -a
106102
- name: setup platform
107103
run: |
108-
apt-get upgrade
109-
apt-get -y install curl ${{ vars.UBUNTU_EXTRA_APT_GET }}
104+
apt-get -y update
105+
apt-get -y upgrade
106+
apt-get -y install \
107+
curl \
108+
jq \
109+
${{ vars.UBUNTU_EXTRA_APT_GET }}
110+
111+
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg --output /usr/share/keyrings/githubcli-archive-keyring.gpg
112+
chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
113+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
114+
apt update
115+
apt-get -y install gh
116+
117+
git config --global --add safe.directory $(pwd)
110118
- name: Perl version check
111119
run: |
112120
perl -V
@@ -140,6 +148,31 @@ jobs:
140148
pwd
141149
ls
142150
rm -rfv HTML-Tagset-*
151+
# Restore the last module installation for this OS/perl combination. This
152+
# saves several minutes in some cases. When cpan installs updates, the
153+
# 'save' counterpart for 'restore' will update the cache.
154+
- name: Restore Perl modules
155+
id: perl-modules-cache-restore
156+
uses: actions/cache/restore@v4
157+
with:
158+
key: ${{ runner.os }}-${{ matrix.perl-version }}-modules
159+
path: |
160+
/usr/local/lib/perl5
161+
/usr/local/bin/cover
162+
/usr/local/bin/cpan
163+
# We cannot reuse cache keys, so we'll delete it and then save it again
164+
# There are various hacks for this, but GitHub has so far declined to
165+
# do what so many people want. This seems like a long way to go to do
166+
# this, but most of the problem is translating the unique cache key name
167+
# to another hidden ID value. This is pervasive in the GitHub API.
168+
- name: Delete cache
169+
id: delete-cache
170+
env:
171+
GH_TOKEN: ${{ github.token }}
172+
run: |
173+
gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${{ github.repository }}/actions/caches \
174+
| jq -r '.actions_caches[] | select(.key == "${{ steps.perl-modules-cache-restore.outputs.cache-primary-key }}") | .id' \
175+
| xargs -I{} gh api --method DELETE -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${{ github.repository }}/actions/caches/{}
143176
# I had some problems with openssl on Ubuntu, so I punted by installing
144177
# cpanm first, which is easy. I can install IO::Socket::SSL with that,
145178
# then switch back to cpan. I didn't explore this further, but what you
@@ -194,9 +227,21 @@ jobs:
194227
# Devel::Cover 1.39
195228
- name: Run coverage tests
196229
if: env.PERL_VERSION != 'v5.8' && env.PERL_VERSION != 'v5.10'
230+
continue-on-error: true
197231
env:
198232
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
199233
run: |
200234
cpanm --notest Devel::Cover Devel::Cover::Report::Coveralls
201235
perl Makefile.PL
202-
cover -test -report coveralls
236+
cover -test +ignore 'Makefile.PL' -report coveralls
237+
# Now always save the Perl modules in case we updated some versions
238+
- name: Save Perl modules
239+
id: perl-modules-cache-save
240+
uses: actions/cache/save@v4
241+
if: always()
242+
with:
243+
key: ${{ steps.perl-modules-cache-restore.outputs.cache-primary-key }}
244+
path: |
245+
/usr/local/lib/perl5
246+
/usr/local/bin/cover
247+
/usr/local/bin/cpan

.github/workflows/macos.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# brian's standard GitHub Actions macOS config for Perl 5 modules
2-
# version 20250125.002
2+
# version 20250811.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
@@ -71,7 +71,10 @@ jobs:
7171
environment: automated_testing
7272
runs-on: macOS-latest
7373
steps:
74-
- uses: actions/checkout@v3
74+
- uses: actions/checkout@v5
75+
- name: git corrections
76+
run: |
77+
git config --global --add safe.directory "$(pwd)"
7578
- name: Platform check
7679
run: uname -a
7780
- name: Set up Perl
@@ -81,6 +84,27 @@ jobs:
8184
perl -v | perl -0777 -ne 'm/(v5\.\d+)/ && print "PERL_VERSION=$1"' >> $GITHUB_ENV
8285
- name: Perl version check
8386
run: perl -V
87+
# reload the cache so we don't need to reinstall modules, This can save
88+
# several minutes.
89+
- name: Load cache
90+
id: perl-modules-cache-restore
91+
uses: actions/cache/restore@v4
92+
with:
93+
key: ${{ runner.os }}-perl-modules
94+
path: |
95+
/opt/homebrew/Cellar/perl/*/lib
96+
/opt/homebrew/Cellar/perl/*/bin
97+
# We cannot reuse cache keys, so we'll delete it and then save it again
98+
# There are various hacks for this, but GitHub has so far declined to
99+
# do what so many people want
100+
- name: Delete cache
101+
id: delete-cache
102+
env:
103+
GH_TOKEN: ${{ github.token }}
104+
run: |
105+
gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${{ github.repository }}/actions/caches \
106+
| jq -r '.actions_caches[] | select(.key == "${{ steps.perl-modules-cache-restore.outputs.cache-primary-key }}") | .id' \
107+
| xargs -I{} gh api --method DELETE -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${{ github.repository }}/actions/caches/{}
84108
# cpan can operate with https, but we need IO::SSL::Socket, which
85109
# does not come with Perl.
86110
#
@@ -134,9 +158,20 @@ jobs:
134158
# Devel::Cover instances don't work with 5.8
135159
- name: Run coverage tests
136160
if: env.PERL_VERSION != 'v5.8'
161+
continue-on-error: true
137162
env:
138163
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
139164
run: |
140165
cpan -M https://www.cpan.org -T Devel::Cover Devel::Cover::Report::Coveralls
141166
perl Makefile.PL
142-
cover -test -report coveralls
167+
cover -test +ignore 'Makefile.PL' -report coveralls
168+
# Now always save the Perl modules in case we updated some versions
169+
- name: Save cache
170+
id: perl-modules-cache-save
171+
uses: actions/cache/save@v4
172+
if: always()
173+
with:
174+
key: ${{ steps.perl-modules-cache-restore.outputs.cache-primary-key }}
175+
path: |
176+
/opt/homebrew/Cellar/perl/*/lib
177+
/opt/homebrew/Cellar/perl/*/bin

.github/workflows/release.yml

Lines changed: 7 additions & 8 deletions
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 20250226.001
2+
# version 20250811.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
@@ -9,10 +9,6 @@
99
# that hard, but that doesn't fit with my workflow since this part
1010
# happens after everything else has succeeded.
1111
#
12-
# This requires that you configure a repository secret named
13-
# RELEASE_ACTION_TOKEN with a GitHub Personal Access Token
14-
# that has "read and write" permissions on Repository/Contents
15-
#
1612
# Variables that you can set in the "automated_testing" environment:
1713
#
1814
# EXTRA_CPAN_MODULES - extra arguments to the first call to cpan.
@@ -64,13 +60,16 @@ jobs:
6460
strategy:
6561
matrix:
6662
os:
67-
- ubuntu-24.04
63+
- ubuntu-latest
6864
perl-version:
6965
- 'latest'
7066
container:
7167
image: perl:${{ matrix.perl-version }}
7268
steps:
73-
- uses: actions/checkout@v3
69+
- uses: actions/checkout@v5
70+
- name: git corrections
71+
run: |
72+
git config --global --add safe.directory `pwd`
7473
# Some older versions of Perl have trouble with hostnames in certs. I
7574
# haven't figured out why.
7675
- name: Setup environment
@@ -134,4 +133,4 @@ jobs:
134133
${{ env.ASSET_NAME }}
135134
${{ steps.attestation.outputs.bundle-path }}
136135
${{ vars.EXTRA_RELEASE_PATHS }}
137-
token: ${{ secrets.RELEASE_ACTION_TOKEN }}
136+
token: ${{ github.token }}

.github/workflows/windows.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# brian's standard GitHub Actions Windows config for Perl 5 modules
2-
# version 20250126.001
2+
# version 20250811.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
@@ -72,11 +72,14 @@ jobs:
7272
strategy:
7373
matrix:
7474
os:
75-
- windows-2019
7675
- windows-2022
76+
- windows-2025
7777
steps:
7878
- run: git config --global core.autocrlf false
79-
- uses: actions/checkout@v3
79+
- uses: actions/checkout@v5
80+
- name: git corrections
81+
run: |
82+
git config --global --add safe.directory "%cd%"
8083
- name: Set up Perl
8184
run: |
8285
choco uninstall strawberryperl
@@ -142,7 +145,8 @@ jobs:
142145
if: env.WINDOWS_SKIP_COVERAGE != 0
143146
env:
144147
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
148+
continue-on-error: true
145149
run: |
146150
cpan -M https://www.cpan.org -T Devel::Cover Devel::Cover::Report::Coveralls
147151
perl Makefile.PL
148-
cover -test -report coveralls
152+
cover -test +ignore 'Makefile.PL' -report coveralls

0 commit comments

Comments
 (0)