1
1
# brian's standard GitHub Actions Ubuntu config for Perl 5 modules
2
- # version 20250416.001
2
+ # version 20250617.003
3
3
# https://github.com/briandfoy/github_workflows
4
4
# https://github.com/features/actions
5
5
# This file is licensed under the Artistic License 2.0
70
70
pull_request :
71
71
# weekly build on the master branch just to see what CPAN is doing
72
72
schedule :
73
- - cron : " 37 3 * * 0 "
73
+ - cron : " 19 7 * * 6 "
74
74
jobs :
75
75
perl :
76
76
environment : automated_testing
@@ -92,13 +92,27 @@ jobs:
92
92
image : perl:${{ matrix.perl-version }}
93
93
steps :
94
94
- uses : actions/checkout@v3
95
+ - name : git corrections
96
+ run : |
97
+ git config --global --add safe.directory "$(pwd)"
95
98
- name : Platform check
96
99
run : uname -a
97
100
- name : setup platform
98
101
run : |
99
102
apt-get -y update
100
103
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)
102
116
- name : Perl version check
103
117
run : |
104
118
perl -V
@@ -132,6 +146,31 @@ jobs:
132
146
pwd
133
147
ls
134
148
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/{}
135
174
# I had some problems with openssl on Ubuntu, so I punted by installing
136
175
# cpanm first, which is easy. I can install IO::Socket::SSL with that,
137
176
# then switch back to cpan. I didn't explore this further, but what you
@@ -186,9 +225,21 @@ jobs:
186
225
# Devel::Cover 1.39
187
226
- name : Run coverage tests
188
227
if : env.PERL_VERSION != 'v5.8' && env.PERL_VERSION != 'v5.10'
228
+ continue-on-error : true
189
229
env :
190
230
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
191
231
run : |
192
232
cpanm --notest Devel::Cover Devel::Cover::Report::Coveralls
193
233
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
0 commit comments