-
Notifications
You must be signed in to change notification settings - Fork 274
209 lines (172 loc) · 6.54 KB
/
ci.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
204
205
206
207
208
name: CI
on:
push:
branches: '**'
pull_request:
branches: '**'
schedule:
- cron: '42 5 * * *'
# Build and test Dancer on several versions of Perl using an image that already has a lot of modules installed.
# This will provide a fast feedback if a commit broke anything in the unit-tests.
# Using 5.32 we also create the tar.gz file and save it as an artifact.
#
# Once this job passed we launch several jobs in parallel
# 1) Verify that we can install the created distribution on many versions of Perl using a Linux Docker image with vanilla Perl.
# 2) Verify that we can install the created distribution on native Linux/Windows/OSX.
# 3) Verify that a mumber of plugins and other distributions that depend on Dancer, that the new version won't break them.
# We run the job on every push and every pull-request.
# We also run them periodically to makes sure none changes in dependencies of Dancer don't break it even during the days when the
# Dancer developers rest.
jobs:
build-in-container:
if: ${{ github.repository == 'PerlDancer/Dancer2' || github.event_name != 'schedule' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
perl-version:
- 'latest'
- '5.36-bookworm'
- '5.20-buster'
container:
image: perldocker/perl-tester:${{ matrix.perl-version }} # https://hub.docker.com/r/perldocker/perl-tester
name: Build on Linux with Perl ${{ matrix.perl-version }}
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
perl -v
dzil authordeps --missing | cpanm --notest
dzil listdeps --author --missing | cpanm --notest
- name: Regular tests
run: |
dzil test --author --release
# test t/issues/gh-811.t depends on Dancer2::Session::Cookie so it is skipped the first time
# but it feel cleaner to run the tests once before we install Dancer
- name: Install Extra dependencies
run: |
cpanm --notest Dancer2::Session::Cookie
- name: Full test cycle
run: |
dzil test --author --release
- name: Create release
if: ${{ matrix.perl-version == 'latest' }}
run: |
# Increase the version number by 0.000001 so in the reports we can be sure we are using the code to be released.
perl -i -p -e 's/^version\s*=\s*(\d+\.\d+)/"version = " . ($1 + 0.000001)/e' dist.ini
dzil build
- name: Archive artifacts
if: ${{ matrix.perl-version == 'latest' }}
uses: actions/upload-artifact@v2
with:
name: the-dancer
path: |
Dancer2-*.tar.gz
test-on-clean-perl:
runs-on: ubuntu-latest
needs: build-in-container
strategy:
fail-fast: false
matrix:
perl-version:
- 'latest'
- "5.36-bookworm"
- "5.20-buster"
# - "5.28"
# - "5.26"
# - "5.24"
# - "5.22"
#- "5.20"
# - "5.18"
# - "5.16"
# - "5.14"
container:
image: perl:${{ matrix.perl-version }}
name: Test Dancer on ${{ matrix.perl-version }}
steps:
- name: Download a single artifact
uses: actions/download-artifact@v2
with:
name: the-dancer
- name: Install Dancer
run: |
perl -v
cpanm Dancer2-*.tar.gz
perl -MDancer2 -e 'print "$Dancer2::VERSION\n"'
test-downstream:
runs-on: ubuntu-latest
needs: build-in-container
strategy:
fail-fast: false
matrix:
perl-version:
- 'latest'
container:
image: perldocker/perl-tester:${{ matrix.perl-version }} # https://hub.docker.com/r/perldocker/perl-tester
name: Test downstream on ${{ matrix.perl-version }}
steps:
- name: Download a single artifact
uses: actions/download-artifact@v2
with:
name: the-dancer
- name: Install Dancer
run: |
perl -v
cpanm Dancer2-*.tar.gz
perl -MDancer2 -e 'print "$Dancer2::VERSION\n"'
- name: Testing selected Plugins
run: |
#cpanm --test-only --verbose Dancer2::Plugin::Auth::HTTP::Basic::DWIW # TODO: Re-enable once patched for Dancer 1.0.0
cpanm --test-only --verbose Dancer2::Template::Handlebars
cpanm --test-only --verbose Dancer2::Session::Cookie
cpanm --test-only --verbose Dancer2::Plugin::Email
cpanm --test-only --verbose Dancer2::Plugin::Auth::Extensible
cpanm --test-only --verbose Dancer2::Plugin::DBIC
- name: Testing selected downstream modules
run: |
# cpanm App::Mxpress::PDF # Couldn't find module or a distribution MetaCPAN::CLient::Pod::PDF
# cpanm App::unbelievable
# cpanm TT2::Play::Area
cpanm App::Notifier::Service
cpanm Map::Tube::Server
native:
needs: build-in-container
strategy:
fail-fast: false
matrix:
# Windows tests are reporting failures on warnings, and I have no time to figure out why for now.
# Will resolve and uncomment later.
#runner: [ubuntu-latest, macos-latest, windows-latest]
runner: [ubuntu-latest, macos-latest]
perl: [ 'latest' ]
runs-on: ${{matrix.runner}}
name: Native on OS ${{matrix.runner}} Perl ${{matrix.perl}}
steps:
- name: Download a single artifact
uses: actions/download-artifact@v2
with:
name: the-dancer
- name: Set up perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
distribution: ${{ ( startsWith( matrix.runner, 'windows-' ) && 'strawberry' ) || 'default' }}
- name: Install Dancer on Windows
if: ${{ startsWith( matrix.runner, 'windows-' ) }}
run: |
perl -v
# Unclear why Test::TCP fails on GitHub Actions on Windows, but this seems to be related:
# https://github.com/tokuhirom/Test-TCP/pull/99
cpanm --notest Test::TCP
dir
Set-Content -NoNewline "cpanm --verbose " install.bat
Get-ChildItem -Name Dancer2* >> install.bat
dir
type install.bat
.\install.bat
perl -MDancer2 -e "print qq{$Dancer2::VERSION\n}"
- name: Install Dancer on Linux and OSX
if: ${{ ! startsWith( matrix.runner, 'windows-' ) }}
run: |
cpanm Dancer2-*.tar.gz
perl -MDancer2 -e 'print qq{$Dancer2::VERSION\n}'