-
Notifications
You must be signed in to change notification settings - Fork 4
182 lines (153 loc) · 5.19 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
name: CI
on:
push:
branches: '*'
pull_request:
branches: '*'
schedule:
- cron: '42 5 * * *'
# Build the module 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 the changes won't break some selected downstream distributions.
# We run the job on every push and every pull-request.
# We also run them periodically to makes sure none of changes in our dependencies break it even during the days when
# the developers of this project rest.
jobs:
build-in-container:
runs-on: ubuntu-latest
env:
TERM: xterm-256color
strategy:
fail-fast: false
matrix:
perl-version:
- '5.32'
- '5.30'
- '5.20'
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@v4
- name: Install prerequisites
run: |
perl -v
cpanm --notest Module::Install
cpanm --notest Contextual::Return
cpanm --notest Test::Pod
cpanm --notest Test::Pod::Coverage
cpanm --notest Test::Perl::Critic
apt-get update
apt-get install -y libreadline-dev
cpanm --installdeps --notest .
- name: Regular tests
env:
RELEASE_TESTING: 1
run: |
perl Makefile.PL
make
make test
- name: Create release
if: ${{ matrix.perl-version == '5.32' }}
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+)'/q{VERSION = '} . (\$1 + 0.01) . q{'}/e" lib/Debug/Client.pm
perl Makefile.PL
make
make manifest
make dist
- name: Archive artifacts
if: ${{ matrix.perl-version == '5.32' }}
uses: actions/upload-artifact@v4
with:
name: the-release
path: |
Debug-Client-*.tar.gz
test-on-clean-perl:
runs-on: ubuntu-latest
needs: build-in-container
strategy:
fail-fast: false
matrix:
perl-version:
#- '5.38'
- '5.32'
- "5.30"
- "5.28"
- "5.26"
#- "5.24"
#- "5.22"
#- "5.20"
#- "5.18"
#- "5.16"
#- "5.14"
#- "5.12"
#- "5.10"
container:
image: perl:${{ matrix.perl-version }}
env:
TERM: xterm-256color
name: Test on ${{ matrix.perl-version }}
steps:
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: the-release
- name: Install System level dependency
run: |
apt-get update
apt-get install -y libreadline-dev
- name: Install Module
run: |
perl -v
cpanm --verbose Debug-Client-*.tar.gz
native:
needs: build-in-container
strategy:
fail-fast: false
matrix:
runner: [ubuntu-latest, macos-latest, windows-latest]
#runner: [windows-latest]
perl: [ '5.32' ]
runs-on: ${{matrix.runner}}
name: Native on OS ${{matrix.runner}} Perl ${{matrix.perl}}
steps:
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: the-release
- name: Set up perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
distribution: ${{ ( startsWith( matrix.runner, 'windows-' ) && 'strawberry' ) || 'default' }}
- name: Install Module on Windows
if: ${{ startsWith( matrix.runner, 'windows-' ) }}
run: |
perl -v
Set-Content -NoNewline "cpanm --verbose " install.bat
Get-ChildItem -Name Debug-Client* >> install.bat
dir
type install.bat
.\install.bat
perl -MDebug::Client -e "print qq{$Debug::Client::VERSION\n}"
- name: Install Module on Linux
if: ${{ startsWith( matrix.runner, 'ubuntu-' ) }}
env:
TERM: xterm-256color
run: |
sudo apt-get update
sudo apt-get install -y libreadline-dev
cpanm --verbose Debug-Client-*.tar.gz
perl -MDebug::Client -e 'print qq{$Debug::Client::VERSION\n}'
# - name: Install Module on Mac OSX
# if: ${{ startsWith( matrix.runner, 'macos-' ) }}
# run: |
# #?? apt-get install -y libreadline-dev
# cpanm --verbose Debug-Client-*.tar.gz
# perl -MDebug::Client -e 'print qq{$Debug::Client::VERSION\n}'