Skip to content

Commit 00a2539

Browse files
committed
Updated GitHub workflows from https://github.com/briandfoy/github_workflows
5e252b18afa859271ae4e0ea6d205f4cc25937ad * �[92mlinux.yml�[0m upgraded: 20250416.001 -> 20250617.003 * �[92mmacos.yml�[0m upgraded: 20250125.002 -> 20250617.001 * �[92mrelease.yml�[0m upgraded: 20250418.001 -> 20250515.001 * �[92mwindows.yml�[0m upgraded: 20250316.001 -> 20250515.001
1 parent 74a4f93 commit 00a2539

File tree

4 files changed

+102
-9
lines changed

4 files changed

+102
-9
lines changed

.github/workflows/linux.yml

Lines changed: 55 additions & 4 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
@@ -70,7 +70,7 @@ on:
7070
pull_request:
7171
# weekly build on the master branch just to see what CPAN is doing
7272
schedule:
73-
- cron: "37 3 * * 0"
73+
- cron: "19 7 * * 6"
7474
jobs:
7575
perl:
7676
environment: automated_testing
@@ -92,13 +92,27 @@ jobs:
9292
image: perl:${{ matrix.perl-version }}
9393
steps:
9494
- uses: actions/checkout@v3
95+
- name: git corrections
96+
run: |
97+
git config --global --add safe.directory "$(pwd)"
9598
- name: Platform check
9699
run: uname -a
97100
- name: setup platform
98101
run: |
99102
apt-get -y update
100103
apt-get -y upgrade
101-
apt-get -y install curl ${{ vars.UBUNTU_EXTRA_APT_GET }}
104+
apt-get -y install \
105+
curl \
106+
jq \
107+
${{ vars.UBUNTU_EXTRA_APT_GET }}
108+
109+
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg --output /usr/share/keyrings/githubcli-archive-keyring.gpg
110+
chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
111+
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
112+
apt update
113+
apt-get -y install gh
114+
115+
git config --global --add safe.directory $(pwd)
102116
- name: Perl version check
103117
run: |
104118
perl -V
@@ -132,6 +146,31 @@ jobs:
132146
pwd
133147
ls
134148
rm -rfv HTML-Tagset-*
149+
# Restore the last module installation for this OS/perl combination. This
150+
# saves several minutes in some cases. When cpan installs updates, the
151+
# 'save' counterpart for 'restore' will update the cache.
152+
- name: Restore Perl modules
153+
id: perl-modules-cache-restore
154+
uses: actions/cache/restore@v4
155+
with:
156+
key: ${{ runner.os }}-${{ matrix.perl-version }}-modules
157+
path: |
158+
/usr/local/lib/perl5
159+
/usr/local/bin/cover
160+
/usr/local/bin/cpan
161+
# We cannot reuse cache keys, so we'll delete it and then save it again
162+
# There are various hacks for this, but GitHub has so far declined to
163+
# do what so many people want. This seems like a long way to go to do
164+
# this, but most of the problem is translating the unique cache key name
165+
# to another hidden ID value. This is pervasive in the GitHub API.
166+
- name: Delete cache
167+
id: delete-cache
168+
env:
169+
GH_TOKEN: ${{ github.token }}
170+
run: |
171+
gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${{ github.repository }}/actions/caches \
172+
| jq -r '.actions_caches[] | select(.key == "${{ steps.perl-modules-cache-restore.outputs.cache-primary-key }}") | .id' \
173+
| 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/{}
135174
# I had some problems with openssl on Ubuntu, so I punted by installing
136175
# cpanm first, which is easy. I can install IO::Socket::SSL with that,
137176
# then switch back to cpan. I didn't explore this further, but what you
@@ -186,9 +225,21 @@ jobs:
186225
# Devel::Cover 1.39
187226
- name: Run coverage tests
188227
if: env.PERL_VERSION != 'v5.8' && env.PERL_VERSION != 'v5.10'
228+
continue-on-error: true
189229
env:
190230
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
191231
run: |
192232
cpanm --notest Devel::Cover Devel::Cover::Report::Coveralls
193233
perl Makefile.PL
194-
cover -test -report coveralls
234+
cover -test +ignore 'Makefile.PL' -report coveralls
235+
# Now always save the Perl modules in case we updated some versions
236+
- name: Save Perl modules
237+
id: perl-modules-cache-save
238+
uses: actions/cache/save@v4
239+
if: always()
240+
with:
241+
key: ${{ steps.perl-modules-cache-restore.outputs.cache-primary-key }}
242+
path: |
243+
/usr/local/lib/perl5
244+
/usr/local/bin/cover
245+
/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)