-
-
Notifications
You must be signed in to change notification settings - Fork 7
203 lines (201 loc) · 6.02 KB
/
dzil-build-and-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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
---
name: dzil build and test
on:
push:
branches:
- "main"
pull_request:
branches:
- "*"
workflow_dispatch:
jobs:
build-job:
name: Build distribution
runs-on: ubuntu-20.04
container:
image: perldocker/perl-tester:5.38
steps:
- uses: actions/checkout@v4
- name: Install ubi
run: curl --silent --location https://raw.githubusercontent.com/houseabsolute/ubi/master/bootstrap/bootstrap-ubi.sh | sh
- name: Install omegasort
run: ubi --project houseabsolute/omegasort --in /usr/local/bin
- name: Install precious
run: ubi --project houseabsolute/precious --in /usr/local/bin
- name: install test-needs deps
run: cpm install -g --cpanfile test-needs-cpanfile
- name: Run Tests
env:
AUTHOR_TESTING: 1
AUTOMATED_TESTING: 1
EXTENDED_TESTING: 1
HARNESS_OPTIONS: j2
RELEASE_TESTING: 1
run: auto-build-and-test-dist
- name: Run precious
run: precious lint --all
- uses: actions/upload-artifact@v3
with:
name: build_dir
path: build_dir
if: ${{ github.actor != 'nektos/act' }}
#integration-job:
#needs: build-job
#runs-on: ubuntu-20.04
#timeout-minutes: 15
#container:
#image: perldocker/perl-tester:5.32
#strategy:
#fail-fast: false
#steps:
#- uses: actions/download-artifact@v3
#with:
#name: build_dir
#path: .
#- name: install test-needs deps
#run: cpm install -g --cpanfile test-needs-cpanfile
#- name: Install deps and test
#run: cpan-install-dist-deps && test-dist
#- uses: actions/checkout@v4
#with:
#repository: mojolicious/mojo
#path: mojo
#fetch-depth: 0
#name: check out Mojo
#- name: Install Mojo
#run: cpm install -g Mojo
#- name: check out a tag
#run: cd mojo && git checkout v8.72
#- name: run Mojo tests
#run: cd mojo && prove -lr t
#env:
#TEST_EV: 1
#TEST_HYPNOTOAD: 1
#TEST_MORBO: 1
#TEST_ONLINE: 1
#TEST_UNIX: 1
#- name: Run perlimports on test suite
#run: cd mojo && find t -type f | grep "\.t\$" | grep -v t/mojolicious/commands.t | xargs -L 1 perl -I../lib ../script/perlimports --libs lib,t/mojo/lib -i --no-padding --ignore-modules Test::More,Mojo::Base -f
#- name: run Mojo tests after tidying tests
#run: cd mojo && prove -lr t
#env:
#TEST_EV: 1
#TEST_HYPNOTOAD: 1
#TEST_MORBO: 1
#TEST_ONLINE: 1
#TEST_UNIX: 1
#- name: Hard reset on Mojo checkout
#run: cd mojo && git reset --hard
#- name: Run perlimports on lib
#run: cd mojo && find lib -type f | grep "\.pm\$" | grep -v lib/Mojo/Base.pm | xargs -n 1 perl -I../lib ../script/perlimports -i --libs lib --no-padding -f
#env:
#TEST_EV: 1
#TEST_HYPNOTOAD: 1
#TEST_MORBO: 1
#TEST_ONLINE: 1
#TEST_UNIX: 1
#- name: run Mojo tests after tidying lib
#run: cd mojo && prove -lr t
#env:
#TEST_EV: 1
#TEST_HYPNOTOAD: 1
#TEST_MORBO: 1
#TEST_ONLINE: 1
#TEST_UNIX: 1
coverage-job:
needs: build-job
runs-on: ubuntu-20.04
container:
image: perldocker/perl-tester:5.38
steps:
- uses: actions/checkout@v4 # codecov wants to be inside a Git repository
- uses: actions/download-artifact@v3
with:
name: build_dir
path: .
- name: install test-needs deps
run: cpm install -g --cpanfile test-needs-cpanfile
continue-on-error: true
- name: Install deps and test
run: cpan-install-dist-deps && test-dist
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
HARNESS_OPTIONS: j2
HARNESS_PERL_SWITCHES: "-MDevel::Cover=+ignore,^local/|^t/|^xt|^test-data"
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
test-job:
needs: build-job
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-latest]
perl-version:
- "5.18"
- "5.20"
- "5.22"
- "5.24"
- "5.26"
- "5.28"
- "5.30"
- "5.32"
- "5.34"
- "5.36"
- "5.38"
name: More deps ${{ matrix.perl-version }} on ${{ matrix.os }}
steps:
- name: Set Up Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl-version }}
- uses: actions/download-artifact@v3
with:
name: build_dir
path: .
- name: install test-needs deps
run: cpm install -g --cpanfile test-needs-cpanfile
continue-on-error: true
- name: install deps using cpm
uses: perl-actions/install-with-cpm@v1
with:
cpanfile: "cpanfile"
args: "--with-suggests --with-test --with-develop"
- run: prove -lr -j2 t
without-test-needs-job:
needs: build-job
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
perl-version:
#- "5.12"
#- "5.14"
#- "5.16"
#- "5.18"
#- "5.20"
#- "5.22"
#- "5.24"
#- "5.26"
#- "5.28"
#- "5.30"
#- "5.32"
# - "5.34"
- "5.38"
name: Fewer deps ${{ matrix.perl-version }} on ${{ matrix.os }}
steps:
- name: Set Up Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl-version }}
- uses: actions/download-artifact@v3
with:
name: build_dir
path: .
- name: install deps using cpm
uses: perl-actions/install-with-cpm@v1
with:
cpanfile: "cpanfile"
args: "--with-test"
- run: prove -lr -j2 t