Skip to content

Commit 5975612

Browse files
committed
Add GitHub workflows
1 parent eab6e74 commit 5975612

1 file changed

Lines changed: 178 additions & 0 deletions

File tree

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
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+
14+
jobs:
15+
build:
16+
name: Build distribution
17+
runs-on: ubuntu-latest
18+
strategy:
19+
max-parallel: 1
20+
container:
21+
image: perldocker/perl-tester:5.30
22+
steps:
23+
- uses: actions/checkout@v2
24+
- name: Install author deps
25+
run: dzil authordeps | xargs cpm install -g --show-build-log-on-failure
26+
- name: dzil stale
27+
run: dzil stale | xargs cpm install -g --show-build-log-on-failure
28+
- name: Build
29+
run: dzil build --no-tgz --in dzil_build_dir
30+
- uses: actions/upload-artifact@master
31+
with:
32+
name: build_dir
33+
path: dzil_build_dir
34+
- name: Install deps
35+
if: success()
36+
run: >
37+
cd dzil_build_dir
38+
&& cpm install -g
39+
--cpanfile cpanfile
40+
--with-develop
41+
--with-recommends
42+
--with-suggests
43+
--show-build-log-on-failure
44+
- name: Run Tests with coverage
45+
if: success()
46+
env:
47+
AUTHOR_TESTING: 1
48+
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
49+
HARNESS_PERL_SWITCHES: "-MDevel::Cover=+ignore,^local/|^t/|^xt"
50+
RELEASE_TESTING: 1
51+
run: >
52+
cpm install -g
53+
--show-build-log-on-failure
54+
Devel::Cover::Report::Codecov &&
55+
cd dzil_build_dir
56+
&& prove -lr --jobs 2 t xt
57+
&& cover -report codecov
58+
test_linux:
59+
runs-on: ubuntu-latest
60+
name: Perl ${{ matrix.perl-version }} on ubuntu-latest
61+
needs: build
62+
strategy:
63+
matrix:
64+
perl-version:
65+
- "5.10"
66+
- "5.12"
67+
- "5.14"
68+
- "5.16"
69+
- "5.18"
70+
- "5.20"
71+
- "5.22"
72+
- "5.24"
73+
- "5.26"
74+
- "5.28"
75+
- "5.30"
76+
container:
77+
image: perldocker/perl-tester:${{ matrix.perl-version }}
78+
env:
79+
AUTHOR_TESTING: 1
80+
RELEASE_TESTING: 1
81+
steps:
82+
- uses: actions/download-artifact@master
83+
with:
84+
name: build_dir
85+
path: .
86+
- name: Install deps
87+
if: success()
88+
run: >
89+
cpm install -g
90+
--cpanfile cpanfile
91+
--with-develop
92+
--with-suggests
93+
--show-build-log-on-failure
94+
- name: Run Tests
95+
if: success()
96+
run: prove -lr --jobs 2 t xt
97+
test_macos:
98+
runs-on: ${{ matrix.os }}
99+
strategy:
100+
fail-fast: true
101+
matrix:
102+
os: ["macos-latest"]
103+
perl-version:
104+
- "5.10"
105+
- "5.12"
106+
- "5.14"
107+
- "5.16"
108+
- "5.18"
109+
- "5.20"
110+
- "5.22"
111+
- "5.24"
112+
- "5.26"
113+
- "5.28"
114+
- "5.30"
115+
name: Perl ${{ matrix.perl-version }} on ${{ matrix.os }}
116+
needs: build
117+
steps:
118+
- uses: actions/checkout@v2
119+
- name: Set Up Perl
120+
uses: shogo82148/actions-setup-perl@v1.3.0
121+
with:
122+
perl-version: ${{ matrix.perl-version }}
123+
- uses: actions/download-artifact@master
124+
with:
125+
name: build_dir
126+
path: .
127+
- run: perl -V
128+
- name: install deps using cpanm
129+
uses: perl-actions/install-with-cpm@v1.3
130+
with:
131+
cpanfile: "cpanfile"
132+
args: "--with-develop --with-recommends --with-suggests --with-test"
133+
sudo: false
134+
- run: prove -l t xt
135+
env:
136+
AUTHOR_TESTING: 1
137+
RELEASE_TESTING: 1
138+
test_windows:
139+
runs-on: ${{ matrix.os }}
140+
strategy:
141+
fail-fast: true
142+
matrix:
143+
os: ["windows-latest"]
144+
perl-version:
145+
# https://github.com/shogo82148/actions-setup-perl/issues/223
146+
#- "5.10"
147+
#- "5.12"
148+
#- "5.14"
149+
#- "5.16"
150+
#- "5.18"
151+
#- "5.20"
152+
#- "5.22"
153+
- "5.24"
154+
- "5.26"
155+
- "5.28"
156+
- "5.30"
157+
name: Perl ${{ matrix.perl-version }} on ${{ matrix.os }}
158+
needs: build
159+
steps:
160+
- uses: actions/checkout@v2
161+
- name: Set Up Perl
162+
uses: shogo82148/actions-setup-perl@v1.3.0
163+
with:
164+
perl-version: ${{ matrix.perl-version }}
165+
- uses: actions/download-artifact@master
166+
with:
167+
name: build_dir
168+
path: .
169+
- name: install deps using cpanm
170+
uses: perl-actions/install-with-cpanm@v1.1
171+
with:
172+
cpanfile: "cpanfile"
173+
sudo: false
174+
- run: perl -V
175+
- run: prove -l t xt
176+
env:
177+
AUTHOR_TESTING: 1
178+
RELEASE_TESTING: 1

0 commit comments

Comments
 (0)