Skip to content

Commit 8dc04e8

Browse files
committed
Switch to GitHub workflows
1 parent 7d1a709 commit 8dc04e8

File tree

3 files changed

+142
-3
lines changed

3 files changed

+142
-3
lines changed
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
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-job:
16+
name: Build distribution
17+
runs-on: ubuntu-latest
18+
container:
19+
image: perldocker/perl-tester:5.32
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Run Tests
23+
env:
24+
AUTHOR_TESTING: 1
25+
AUTOMATED_TESTING: 1
26+
EXTENDED_TESTING: 1
27+
RELEASE_TESTING: 1
28+
run: auto-build-and-test-dist
29+
- uses: actions/upload-artifact@v2
30+
with:
31+
name: build_dir
32+
path: build_dir
33+
if: ${{ github.actor != 'nektos/act' }}
34+
coverage-job:
35+
needs: build-job
36+
runs-on: ubuntu-latest
37+
container:
38+
image: perldocker/perl-tester:5.32
39+
steps:
40+
- uses: actions/checkout@v2 # codecov wants to be inside a Git repository
41+
- uses: actions/download-artifact@v2
42+
with:
43+
name: build_dir
44+
path: .
45+
- name: Install deps and test
46+
run: cpan-install-dist-deps && test-dist
47+
env:
48+
AUTHOR_TESTING: 1
49+
AUTOMATED_TESTING: 1
50+
EXTENDED_TESTING: 1
51+
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
52+
httpbin-job:
53+
needs: build-job
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/download-artifact@v2
57+
with:
58+
name: build_dir
59+
path: .
60+
- name: Pull httpbin Docker image
61+
run: docker pull kennethreitz/httpbin
62+
- name: Run httpbin
63+
run: docker run -d -p 31234:80 kennethreitz/httpbin
64+
- name: docker pull perldocker/perl-tester:5.32
65+
run: docker pull perldocker/perl-tester:5.32
66+
- name: Run tests via Docker
67+
run: >
68+
docker run
69+
--network="host"
70+
--env AUTHOR_TESTING=1
71+
-v
72+
$(pwd):/home/dist perldocker/perl-tester:5.32
73+
/bin/sh -c "cd /home/dist && cpan-install-dist-deps && prove -lv xt/rt-112313.t"
74+
test-job:
75+
needs: build-job
76+
runs-on: ${{ matrix.os }}
77+
strategy:
78+
fail-fast: false
79+
matrix:
80+
os: [ubuntu-latest, macos-latest, windows-latest]
81+
perl-version:
82+
- "5.8"
83+
- "5.10"
84+
- "5.12"
85+
- "5.14"
86+
- "5.16"
87+
- "5.18"
88+
- "5.20"
89+
- "5.22"
90+
- "5.24"
91+
- "5.26"
92+
- "5.28"
93+
- "5.30"
94+
- "5.32"
95+
exclude:
96+
- os: windows-latest
97+
perl-version: "5.8"
98+
- os: windows-latest
99+
perl-version: "5.10"
100+
- os: windows-latest
101+
perl-version: "5.12"
102+
- os: windows-latest
103+
perl-version: "5.14"
104+
- os: windows-latest
105+
perl-version: "5.16"
106+
- os: windows-latest
107+
perl-version: "5.32"
108+
name: Perl ${{ matrix.perl-version }} on ${{ matrix.os }}
109+
steps:
110+
- name: Set Up Perl
111+
uses: shogo82148/actions-setup-perl@v1
112+
with:
113+
perl-version: ${{ matrix.perl-version }}
114+
distribution: strawberry # this option only used on Windows
115+
- uses: actions/download-artifact@v2
116+
with:
117+
name: build_dir
118+
path: .
119+
- name: install deps using cpm
120+
uses: perl-actions/install-with-cpm@v1
121+
with:
122+
cpanfile: "cpanfile"
123+
args: "--with-suggests --with-recommends --with-test"
124+
- run: prove -l t xt
125+
env:
126+
AUTHOR_TESTING: 1
127+
RELEASE_TESTING: 1

dist.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ perl = 5.006002
2424
-remove = Test::Synopsis
2525
-remove = Test::TidyAll
2626
-remove = StaticInstall
27+
-remove = Test::Pod::Coverage::Configurable
28+
29+
[Test::Pod::Coverage::Configurable]
30+
trustme = Net::HTTP::Methods => qr/.*/
31+
trustme = Net::HTTP => qr/^(configure|http_connect)$/
32+
trustme = Net::HTTP::NB => qr/^(can_read|sysread)$/
33+
trustme = Net::HTTPS => qr/^(configure|http_connect|http_default_port)$/
2734

2835
[AutoPrereqs]
2936
skip = Net::SSL

xt/rt-112313.t

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# This test requires a locally deployed httpbin
2+
#
3+
# $ docker pull kennethreitz/httpbin
4+
# $ docker run -p 31234:80 kennethreitz/httpbin
5+
16
BEGIN {
27
if ( $ENV{NO_NETWORK_TESTING} ) {
38
print "1..0 # SKIP Live tests disabled due to NO_NETWORK_TESTING\n";
@@ -6,13 +11,13 @@ BEGIN {
611
eval {
712
require IO::Socket::INET;
813
my $s = IO::Socket::INET->new(
9-
PeerHost => "httpbin.org:80",
14+
PeerHost => "localhost:31234",
1015
Timeout => 5,
1116
);
1217
die "Can't connect: $@" unless $s;
1318
};
1419
if ($@) {
15-
print "1..0 # SKIP Can't connect to httpbin.org\n";
20+
print "1..0 # SKIP Can't connect to localhost\n";
1621
print $@;
1722
exit;
1823
}
@@ -42,7 +47,7 @@ sub try
4247

4348
# Need a new socket every time because we're testing with Keep-Alive...
4449
my $s = Net::HTTP->new(
45-
Host => "httpbin.org",
50+
Host => "localhost:31234",
4651
KeepAlive => 1,
4752
PeerHTTPVersion => "1.1",
4853
) or die "$@";

0 commit comments

Comments
 (0)