Skip to content

Commit ae7b5ee

Browse files
simbabqueoalders
authored andcommitted
add github workflow
This is based on the workflow from HTTP::Message. We allow Perl 5.8, so this is turned on. However, several of our xt/ tests require Perl 5.12 or 5.14. We have to be creative in how we exclude 5.8 from running xt/ tests, because 5.8 is larger than 5.12. Also bump Test::More requirement from 0.94 (implicit) to 0.96 to allow our subtests.
1 parent 9dd6348 commit ae7b5ee

3 files changed

Lines changed: 200 additions & 0 deletions

File tree

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
---
2+
name: dzil build and test
3+
4+
on:
5+
push:
6+
branches:
7+
- "*"
8+
pull_request:
9+
branches:
10+
- "*"
11+
schedule:
12+
- cron: "15 4 * * 0" # Every Sunday morning
13+
workflow_dispatch:
14+
15+
jobs:
16+
build:
17+
name: Build distribution
18+
runs-on: ubuntu-latest
19+
strategy:
20+
max-parallel: 1
21+
container:
22+
image: perldocker/perl-tester:5.32
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: Run Tests with coverage
26+
env:
27+
AUTHOR_TESTING: 1
28+
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
29+
RELEASE_TESTING: 1
30+
run: auto-build-and-test-dist
31+
- uses: actions/upload-artifact@master
32+
with:
33+
name: build_dir
34+
path: build_dir
35+
test_linux:
36+
runs-on: ubuntu-latest
37+
name: Perl ${{ matrix.perl-version }} on ubuntu-latest
38+
needs: build
39+
strategy:
40+
matrix:
41+
perl-version:
42+
- "5.8"
43+
- "5.10"
44+
- "5.12"
45+
- "5.14"
46+
- "5.16"
47+
- "5.18"
48+
- "5.20"
49+
- "5.22"
50+
- "5.24"
51+
- "5.26"
52+
- "5.28"
53+
- "5.30"
54+
- "5.32"
55+
- "5.34"
56+
- "5.36"
57+
container:
58+
image: perldocker/perl-tester:${{ matrix.perl-version }}
59+
env:
60+
AUTHOR_TESTING: 1
61+
steps:
62+
- uses: actions/download-artifact@master
63+
with:
64+
name: build_dir
65+
path: .
66+
- name: Install deps - older than 5.14
67+
if: success() && ( matrix.perl-version == 5.8 || matrix.perl-version == 5.10 || matrix.perl-version == 5.12 )
68+
run: >
69+
cpm install -g
70+
--cpanfile cpanfile
71+
--without-develop
72+
--with-suggests
73+
--show-build-log-on-failure
74+
- name: Install deps - 5.14 and newer
75+
if: success() && ( matrix.perl-version != 5.8 && matrix.perl-version != 5.10 && matrix.perl-version != 5.12 )
76+
run: >
77+
cpm install -g
78+
--cpanfile cpanfile
79+
--with-develop
80+
--with-suggests
81+
--show-build-log-on-failure
82+
- name: Run Tests - older than 5.14
83+
if: success() && ( matrix.perl-version == 5.8 || matrix.perl-version == 5.10 || matrix.perl-version == 5.12 )
84+
run: prove -lr --jobs 2 t
85+
- name: Run Tests - 5.14 and newer
86+
if: success() && ( matrix.perl-version != 5.8 && matrix.perl-version != 5.10 && matrix.perl-version != 5.12 )
87+
run: prove -lr --jobs 2 t xt
88+
test_macos:
89+
runs-on: ${{ matrix.os }}
90+
strategy:
91+
fail-fast: true
92+
matrix:
93+
os: ["macos-latest"]
94+
perl-version:
95+
- "5.8"
96+
- "5.10"
97+
- "5.12"
98+
- "5.14"
99+
- "5.16"
100+
- "5.18"
101+
- "5.20"
102+
- "5.22"
103+
- "5.24"
104+
- "5.26"
105+
- "5.28"
106+
- "5.30"
107+
- "5.32"
108+
- "5.34"
109+
- "5.36"
110+
name: Perl ${{ matrix.perl-version }} on ${{ matrix.os }}
111+
needs: build
112+
steps:
113+
- uses: actions/checkout@v2
114+
- name: Set Up Perl
115+
uses: shogo82148/actions-setup-perl@v1
116+
with:
117+
perl-version: ${{ matrix.perl-version }}
118+
- uses: actions/download-artifact@master
119+
with:
120+
name: build_dir
121+
path: .
122+
- run: perl -V
123+
- name: Install deps - older than 5.14
124+
if: success() && ( matrix.perl-version == 5.8 || matrix.perl-version == 5.10 || matrix.perl-version == 5.12 )
125+
uses: perl-actions/install-with-cpm@v1
126+
with:
127+
cpanfile: "cpanfile"
128+
args: >
129+
--without-develop
130+
--with-suggests
131+
--with-test
132+
--mirror https://cpan.metacpan.org
133+
--mirror http://cpan.cpantesters.org
134+
- name: Install deps - 5.14 and newer
135+
if: success() && ( matrix.perl-version != 5.8 && matrix.perl-version != 5.10 && matrix.perl-version != 5.12 )
136+
uses: perl-actions/install-with-cpm@v1
137+
with:
138+
cpanfile: "cpanfile"
139+
args: >
140+
--with-develop
141+
--with-suggests
142+
--with-test
143+
--mirror https://cpan.metacpan.org
144+
--mirror http://cpan.cpantesters.org
145+
- run: perl -V
146+
- name: Run Tests - older than 5.14
147+
if: success() && ( matrix.perl-version == 5.8 || matrix.perl-version == 5.10 || matrix.perl-version == 5.12 )
148+
run: prove -lr t
149+
- name: Run Tests - 5.14 and newer
150+
if: success() && ( matrix.perl-version != 5.8 && matrix.perl-version != 5.10 && matrix.perl-version != 5.12 )
151+
run: prove -lr t xt
152+
env:
153+
AUTHOR_TESTING: 1
154+
test_windows:
155+
runs-on: ${{ matrix.os }}
156+
strategy:
157+
fail-fast: false
158+
matrix:
159+
os: ["windows-latest"]
160+
perl-version:
161+
# https://github.com/shogo82148/actions-setup-perl/issues/223
162+
#- "5.10"
163+
#- "5.12"
164+
- "5.14"
165+
- "5.16"
166+
- "5.18"
167+
- "5.20"
168+
- "5.22"
169+
- "5.24"
170+
- "5.26"
171+
- "5.28"
172+
- "5.30"
173+
- "5.32"
174+
# As of 2022-06-06 5.32 is the latest Strawberry Perl
175+
# - "5.34"
176+
# - "5.36"
177+
name: Perl ${{ matrix.perl-version }} on ${{ matrix.os }}
178+
needs: build
179+
steps:
180+
- uses: actions/checkout@v2
181+
- name: Set Up Perl
182+
uses: shogo82148/actions-setup-perl@v1
183+
with:
184+
perl-version: ${{ matrix.perl-version }}
185+
distribution: strawberry
186+
- uses: actions/download-artifact@master
187+
with:
188+
name: build_dir
189+
path: .
190+
- name: install deps using cpanm
191+
uses: perl-actions/install-with-cpanm@v1
192+
with:
193+
cpanfile: "cpanfile"
194+
args: "--mirror https://cpan.metacpan.org --mirror http://cpan.cpantesters.org"
195+
- run: perl -V
196+
- run: prove -l t xt
197+
env:
198+
AUTHOR_TESTING: 1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ SSL
88
*.tar.gz
99
t/CAN_TALK_TO_OURSELF
1010
t/live/ENABLED
11+
.vscode
1112
xx*

dist.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Encode = 2
3939
HTTP::Request = 6
4040
HTTP::Request::Common = 6.03
4141
perl = 5.008001
42+
Test::More = 0.96
4243
URI = 1.10
4344
[AutoPrereqs]
4445
[CPANFile]

0 commit comments

Comments
 (0)