-
Notifications
You must be signed in to change notification settings - Fork 1
187 lines (176 loc) · 5.55 KB
/
test.yml
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: Test
on:
push: ~
pull_request: ~
jobs:
perl-versions:
runs-on: ubuntu-latest
name: Calculate Perl Versions
outputs:
versions: ${{ steps.perl-versions.outputs.perl-versions }}
steps:
- uses: actions/checkout@v4
- name: Extract perl dependecy
id: prereqs
uses: perl-actions/get-prereqs@v1
with:
sources: prereqs.yml
- id: perl-versions
uses: perl-actions/perl-versions@v1
with:
since-perl: ${{ steps.prereqs.outputs.perl }}
with-devel: true
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.perl-cpm
key: cpm-${{ runner.os }}
- name: Setup local::lib
run: |
echo "$RUNNER_TEMP/perl5/bin" >> "$GITHUB_PATH"
echo "PERL5LIB=$RUNNER_TEMP/perl5/lib/perl5:$PERL5LIB" >> "$GITHUB_ENV"
echo "PERL_MB_OPT=--install_base $RUNNER_TEMP/perl5" >> "$GITHUB_ENV"
echo "PERL_MM_OPT=INSTALL_BASE=$RUNNER_TEMP/perl5" >> "$GITHUB_ENV"
- name: Extract Dist::Zilla dependencies
id: authordeps
uses: perl-actions/get-prereqs@v1
with:
sources: dist.ini
phases: author
exclude: '^inc::'
- name: Install authordeps
uses: perl-actions/install-with-cpm@v1
with:
sudo: false
install: ${{ steps.authordeps.outputs.prereqs }}
- name: Build
id: build
run: |
DZIL_COLOR=1 dzil build --no-tgz | tee "/tmp/dzil-build.log"
echo build="$(grep --only-matching 'built in .*' "/tmp/dzil-build.log" | tail -1 | cut -c10-)" >> "$GITHUB_OUTPUT"
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build.outputs.build }}
path: ${{ steps.build.outputs.build }}
include-hidden-files: true
outputs:
name: ${{ steps.build.outputs.build }}
test:
needs:
- perl-versions
- build
strategy:
fail-fast: false
matrix:
perl-version: ${{ fromJson(needs.perl-versions.outputs.versions) }}
runs-on: ubuntu-latest
container:
image: perl:${{ matrix.perl-version }}-buster
env:
AUTOMATED_TESTING: 1
PERL_USE_UNSAFE_INC: 0
steps:
- name: Download build
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.name }}
- uses: actions/cache@v4
with:
path: ~/.perl-cpm
key: cpm-perl:${{ matrix.perl-version }}-buster
- name: Setup local::lib
run: |
echo "$RUNNER_TEMP/perl5/bin" >> "$GITHUB_PATH"
echo "PERL5LIB=$RUNNER_TEMP/perl5/lib/perl5:$PERL5LIB" >> "$GITHUB_ENV"
echo "PERL_MB_OPT=--install_base $RUNNER_TEMP/perl5" >> "$GITHUB_ENV"
echo "PERL_MM_OPT=INSTALL_BASE=$RUNNER_TEMP/perl5" >> "$GITHUB_ENV"
- name: Extract configure dependecies
id: configure
uses: perl-actions/get-prereqs@v1
with:
phases: configure
- name: Install configure deps
uses: perl-actions/install-with-cpm@v1
with:
sudo: false
install: ${{ steps.configure.outputs.prereqs }}
- name: Run Makefile.PL
run: perl Makefile.PL
- name: Extract dependecies
id: prereqs
uses: perl-actions/get-prereqs@v1
with:
phases: build test runtime
relationships: requires recommends suggests
- name: Install deps
uses: perl-actions/install-with-cpm@v1
with:
sudo: false
install: ${{ steps.prereqs.outputs.prereqs }}
- name: Run the tests
run: make test
env:
AUTHOR_TESTING: 1
test-xt:
needs:
- perl-versions
- build
runs-on: ubuntu-latest
container:
image: perl:5.36-buster
env:
AUTOMATED_TESTING: 1
steps:
- name: Download build
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.name }}
- uses: actions/cache@v4
with:
path: ~/.perl-cpm
key: cpm-perl:5.36-buster
- name: Setup local::lib
run: |
echo "$RUNNER_TEMP/perl5/bin" >> "$GITHUB_PATH"
echo "PERL5LIB=$RUNNER_TEMP/perl5/lib/perl5:$PERL5LIB" >> "$GITHUB_ENV"
echo "PERL_MB_OPT=--install_base $RUNNER_TEMP/perl5" >> "$GITHUB_ENV"
echo "PERL_MM_OPT=INSTALL_BASE=$RUNNER_TEMP/perl5" >> "$GITHUB_ENV"
- name: Extract configure dependecies
id: configure
uses: perl-actions/get-prereqs@v1
with:
phases: configure
exclude: '^lib$'
- name: Install configure deps
uses: perl-actions/install-with-cpm@v1
with:
sudo: false
install: ${{ steps.configure.outputs.prereqs }}
- name: Run Makefile.PL
run: perl Makefile.PL
- name: Extract dependecies
id: prereqs
uses: perl-actions/get-prereqs@v1
with:
phases: build test runtime develop
relationships: requires recommends suggests
exclude: '^lib$'
- name: Install deps
uses: perl-actions/install-with-cpm@v1
with:
sudo: false
install: ${{ steps.prereqs.outputs.prereqs }}
- name: Run the xt tests
if: hashFiles('xt/*.t')
run: prove -l xt
env:
AUTHOR_TESTING: 1
- name: Run the xt/author tests
if: hashFiles('xt/author/**/*.t')
run: prove -lr xt/author
env:
AUTHOR_TESTING: 1