Skip to content

Commit 8cdcb1e

Browse files
committed
Updated GitHub workflows from https://github.com/briandfoy/github_workflows
5e252b18afa859271ae4e0ea6d205f4cc25937ad * �[92mclosed_pull_request.yml�[0m upgraded: no version -> no version * �[92mlinux.yml�[0m upgraded: 20250416.001 -> 20250617.003 * �[92mmacos.yml�[0m upgraded: 20250125.002 -> 20250617.001 * �[92mnew_pull_request.yml�[0m upgraded: no version -> no version * �[92mpr-labeler.yml�[0m upgraded: no version -> no version * �[92mrelease.yml�[0m upgraded: 20250418.001 -> 20250515.001 * �[92mwindows.yml�[0m upgraded: 20250316.001 -> 20250515.001
1 parent 0d069a7 commit 8cdcb1e

File tree

4 files changed

+101
-8
lines changed

4 files changed

+101
-8
lines changed

.github/workflows/linux.yml

Lines changed: 54 additions & 3 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 20250416.001
2+
# version 20250617.003
33
# https://github.com/briandfoy/github_workflows
44
# https://github.com/features/actions
55
# This file is licensed under the Artistic License 2.0
@@ -101,13 +101,27 @@ jobs:
101101
image: perl:${{ matrix.perl-version }}
102102
steps:
103103
- uses: actions/checkout@v3
104+
- name: git corrections
105+
run: |
106+
git config --global --add safe.directory "$(pwd)"
104107
- name: Platform check
105108
run: uname -a
106109
- name: setup platform
107110
run: |
108111
apt-get -y update
109112
apt-get -y upgrade
110-
apt-get -y install curl ${{ vars.UBUNTU_EXTRA_APT_GET }}
113+
apt-get -y install \
114+
curl \
115+
jq \
116+
${{ vars.UBUNTU_EXTRA_APT_GET }}
117+
118+
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg --output /usr/share/keyrings/githubcli-archive-keyring.gpg
119+
chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
120+
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
121+
apt update
122+
apt-get -y install gh
123+
124+
git config --global --add safe.directory $(pwd)
111125
- name: Perl version check
112126
run: |
113127
perl -V
@@ -141,6 +155,31 @@ jobs:
141155
pwd
142156
ls
143157
rm -rfv HTML-Tagset-*
158+
# Restore the last module installation for this OS/perl combination. This
159+
# saves several minutes in some cases. When cpan installs updates, the
160+
# 'save' counterpart for 'restore' will update the cache.
161+
- name: Restore Perl modules
162+
id: perl-modules-cache-restore
163+
uses: actions/cache/restore@v4
164+
with:
165+
key: ${{ runner.os }}-${{ matrix.perl-version }}-modules
166+
path: |
167+
/usr/local/lib/perl5
168+
/usr/local/bin/cover
169+
/usr/local/bin/cpan
170+
# We cannot reuse cache keys, so we'll delete it and then save it again
171+
# There are various hacks for this, but GitHub has so far declined to
172+
# do what so many people want. This seems like a long way to go to do
173+
# this, but most of the problem is translating the unique cache key name
174+
# to another hidden ID value. This is pervasive in the GitHub API.
175+
- name: Delete cache
176+
id: delete-cache
177+
env:
178+
GH_TOKEN: ${{ github.token }}
179+
run: |
180+
gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${{ github.repository }}/actions/caches \
181+
| jq -r '.actions_caches[] | select(.key == "${{ steps.perl-modules-cache-restore.outputs.cache-primary-key }}") | .id' \
182+
| 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/{}
144183
# I had some problems with openssl on Ubuntu, so I punted by installing
145184
# cpanm first, which is easy. I can install IO::Socket::SSL with that,
146185
# then switch back to cpan. I didn't explore this further, but what you
@@ -195,9 +234,21 @@ jobs:
195234
# Devel::Cover 1.39
196235
- name: Run coverage tests
197236
if: env.PERL_VERSION != 'v5.8' && env.PERL_VERSION != 'v5.10'
237+
continue-on-error: true
198238
env:
199239
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
200240
run: |
201241
cpanm --notest Devel::Cover Devel::Cover::Report::Coveralls
202242
perl Makefile.PL
203-
cover -test -report coveralls
243+
cover -test +ignore 'Makefile.PL' -report coveralls
244+
# Now always save the Perl modules in case we updated some versions
245+
- name: Save Perl modules
246+
id: perl-modules-cache-save
247+
uses: actions/cache/save@v4
248+
if: always()
249+
with:
250+
key: ${{ steps.perl-modules-cache-restore.outputs.cache-primary-key }}
251+
path: |
252+
/usr/local/lib/perl5
253+
/usr/local/bin/cover
254+
/usr/local/bin/cpan

.github/workflows/macos.yml

Lines changed: 37 additions & 2 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 20250617.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,6 +72,9 @@ jobs:
7272
runs-on: macOS-latest
7373
steps:
7474
- uses: actions/checkout@v3
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: 4 additions & 1 deletion
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 20250418.001
2+
# version 20250515.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,6 +71,9 @@ jobs:
7171
image: perl:${{ matrix.perl-version }}
7272
steps:
7373
- uses: actions/checkout@v3
74+
- name: git corrections
75+
run: |
76+
git config --global --add safe.directory `pwd`
7477
# Some older versions of Perl have trouble with hostnames in certs. I
7578
# haven't figured out why.
7679
- name: Setup environment

.github/workflows/windows.yml

Lines changed: 6 additions & 2 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 20250316.001
2+
# version 20250515.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
@@ -77,6 +77,9 @@ jobs:
7777
steps:
7878
- run: git config --global core.autocrlf false
7979
- uses: actions/checkout@v3
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)