-
Notifications
You must be signed in to change notification settings - Fork 11
94 lines (80 loc) · 2.9 KB
/
ci.yml
File metadata and controls
94 lines (80 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: CI
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: OS ${{ matrix.runner }} Perl ${{ matrix.perl }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner: [ubuntu-latest, macos-latest, windows-latest]
perl: [ '5.12', '5.30', '5.40', '5.42' ]
exclude:
- runner: windows-latest
perl: '5.12' # because github actions "cannot find binary" for Windows perl 5.12
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
distribution: ${{ ( startsWith( matrix.runner, 'windows-' ) && 'strawberry' ) || 'default' }}
- name: Show Perl Version
run: perl -v
# Cache CPANM build/download artifacts to speed up repeated CI runs
- name: Cache cpanm
uses: actions/cache@v5
with:
path: |
~/.cpanm
~/.cache/cpanm
C:\Users\runneradmin\.cpanm
C:\Users\runneradmin\.cache\cpanm
key: ${{ runner.os }}-perl-${{ matrix.perl }}-cpanm-${{ hashFiles('cpanfile', 'Makefile.PL', 'Build.PL') }}
restore-keys: |
${{ runner.os }}-perl-${{ matrix.perl }}-cpanm-
${{ runner.os }}-perl-
- name: Install Modules
run: cpanm --installdeps --notest .
- name: Show Errors on Windows
if: ${{ failure() && startsWith(matrix.runner, 'windows-') }}
shell: pwsh
run: |
Get-ChildItem C:\Users\ -Force | Format-Table
if (Test-Path "C:\Users\runneradmin\.cpanm\work") {
Get-ChildItem "C:\Users\runneradmin\.cpanm\work" -Recurse -Filter build.log -ErrorAction SilentlyContinue | ForEach-Object {
Write-Host "===== $($_.FullName) ====="
Get-Content $_.FullName -ErrorAction SilentlyContinue
}
}
- name: Show Errors on Ubuntu
if: ${{ failure() && startsWith(matrix.runner, 'ubuntu-') }}
run: |
ls -la /home/runner/.cpanm/work || true
cat /home/runner/.cpanm/work/*/build.log || true
- name: Show Errors on macOS
if: ${{ failure() && startsWith(matrix.runner, 'macos-') }}
run: |
ls -la /Users/runner/.cpanm/work || true
cat /Users/runner/.cpanm/work/*/build.log || true
- name: Run tests and capture output
env:
AUTHOR_TESTING: 1
RELEASE_TESTING: 1
run: |
perl Build.PL
perl Build
perl Build test 2>&1 | tee test.log # warnings should not go to STDERR
- name: Annotate Perl deprecation warnings
if: always()
shell: bash
run: |
grep -F "deprecated" test.log | while IFS= read -r line; do
echo "::warning::$line"
done