-
Notifications
You must be signed in to change notification settings - Fork 46
243 lines (230 loc) · 8.56 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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
name: perl
on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:
create:
jobs:
notify:
runs-on: ubuntu-latest
continue-on-error: true
if: ${{ always() }}
steps:
- uses: PDLPorters/devops/github-actions/irc-notifications@master
with:
target-notifications: true
ci:
runs-on: ${{ matrix.os }}
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
perl-version: ['5.16.0']
perl-threaded: [false]
include:
- perl-version: '5.30'
os: ubuntu-latest
release-test: true
coverage: true
- perl-version: '5.30'
os: ubuntu-latest
disttest: true
- perl-version: '5.16.0'
os: ubuntu-latest
perl-threaded: true
- perl-version: '5.30'
os: ubuntu-latest
eumm-blead: 1
- perl-version: '5.30'
os: ubuntu-latest
test-installed: true # test not from blib but after installing
- perl-version: '5.30'
os: ubuntu-latest
disable-fortran: true # what if we don't have Fortran installed?
- perl-version: '5.30'
os: ubuntu-latest
use-clang: true # use `clang` instead of `gcc` default
- perl-version: '5.26'
os: windows-latest
- perl-version: '5.30'
os: macos-latest
steps:
- uses: actions/checkout@v2
- name: 'ci-dist: target-setup-perl'
uses: PDLPorters/devops/github-actions/ci-dist@master
with:
target-setup-perl: true
perl-version: ${{ matrix.perl-version }}
perl-threaded: ${{ matrix.perl-threaded }}
# conditional config
- name: Maybe gfortran
if: "!matrix.disable-fortran"
uses: PDLPorters/devops/github-actions/install-dep-gfortran@master
- name: Use clang?
# clang is already installed in Travis-CI environment. Using PERL_MM_OPT does not work with subdirectory Makefile.PLs so we override Config.pm
# Also, both $Config{cc} and $Config{ld} need to be set because under ELF environments (such as Travis-CI's Ubuntu), this is what Perl's Config.pm does.
if: matrix.use-clang
run: |
[ -d build_aux ] || mkdir build_aux
echo 'package pdl_config_override; use ExtUtils::MakeMaker::Config; $Config{cc} = $Config{ld} = "clang"; 1;' > build_aux/pdl_config_override.pm
echo "PERL5OPT=${PERL5OPT:+${PERL5OPT} }-I$(pwd)/build_aux -Mpdl_config_override" >> $GITHUB_ENV
- name: EUMM blead?
if: matrix.eumm-blead
uses: PDLPorters/devops/github-actions/install-dep-eumm-blead@master
- name: Install PDL dependencies
uses: PDLPorters/devops/github-actions/install-dep-pdl-dep@master
- name: 'ci-dist: target-install-dist-perl-deps'
uses: PDLPorters/devops/github-actions/ci-dist@master
with:
target-install-dist-perl-deps: true
dist-perl-deps-configure: ExtUtils::MakeMaker Devel::CheckLib File::Which
- name: 'ci-dist: target-test-release-testing'
uses: PDLPorters/devops/github-actions/ci-dist@master
with:
target-test-release-testing: true
test-enable-release-testing: ${{ matrix.release-test }}
- name: 'ci-dist: target-test (no coverage)'
uses: PDLPorters/devops/github-actions/ci-dist@master
if: '!matrix.coverage && !matrix.disttest'
with:
target-test: true
test-enable-coverage: ${{ matrix.coverage }}
- name: 'disttest'
if: matrix.disttest
run: |
set -e
( [ -f Makefile ] || $MYPERL Makefile.PL ) && make disttest
- name: Run tests after install (no coverage)
if: '!matrix.coverage && matrix.test-installed'
run: |
set -e
[ -f Makefile ] || perl Makefile.PL
make install
make clean # clean is to ensure no blib
prove -j4 t
- name: 'ci-dist: target-test (with coverage)'
uses: PDLPorters/devops/github-actions/ci-dist@master
if: matrix.coverage
env:
DEVEL_COVER_USE_HARNESS_VAR: 1 # so local::lib vars aren't squashed by D:C even though no 't' dir
with:
target-test: true
test-enable-coverage: ${{ matrix.coverage }}
github-token: ${{ secrets.GITHUB_TOKEN }}
cygwin:
env:
PERL5LIB: /cygdrive/c/cx/lib/perl5:/cygdrive/c/cx/lib/perl5/MSWin32-x64-multi-thread
PERL_LOCAL_LIB_ROOT: /cygdrive/cx
PERL_MB_OPT: --install_base /cygdrive/c/cx
PERL_MM_OPT: INSTALL_BASE=/cygdrive/c/cx
CYGWIN_NOWINPATH: 1
runs-on: windows-latest
# only run on tag because cygwin is slow
if: ${{ github.event_name == 'create' && github.event.ref_type == 'tag' }}
strategy:
fail-fast: false
defaults:
run:
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
shell: powershell
- uses: actions/checkout@v2
- name: Cache Cygwin
uses: actions/cache@v1
with:
path: |
c:\tools\cygwin
!c:\tools\cygwin\home
key: ${{ runner.os }}-build-cygwin-tools
restore-keys: ${{ runner.os }}-build-cygwin-tools
- name: Set up Cygwin
uses: egor-tensin/setup-cygwin@v3
with:
platform: x64
packages: make perl gcc-core gcc-g++ pkg-config libcrypt-devel libssl-devel libnsl-devel git
- name: perl -V
run: |
perl -V
gcc --version
- name: Prepare for cache
run: |
perl -V > perlversion.txt
gcc --version >> perlversion.txt
ls perlversion.txt
- name: Cache CPAN modules
uses: actions/cache@v1
with:
path: c:\cx
key: ${{ runner.os }}-build-cygwin-${{ hashFiles('perlversion.txt') }}
restore-keys: |
${{ runner.os }}-build-cygwin-${{ hashFiles('perlversion.txt') }}
- name: Install Static Dependencies
run: |
export PATH="/cygdrive/c/cx/bin:$PATH"
cd $( cygpath -u $GITHUB_WORKSPACE )
yes | cpan App::cpanminus || true
- name: Install Dynamic Dependencies
run: |
export PATH="/cygdrive/c/cx/bin:$PATH"
cd $( cygpath -u $GITHUB_WORKSPACE )
(cpanm -n Devel::CheckLib File::Which && cpanm -n --installdeps .) || ( cat ~/.cpanm/build.log && false )
- name: Run tests (no coverage)
env:
HARNESS_OPTIONS: j4
run: |
export PATH="/cygdrive/c/cx/bin:$PATH"
cd $( cygpath -u $GITHUB_WORKSPACE )
perl Makefile.PL && make test
- run: |
export PATH="/cygdrive/c/cx/bin:$PATH"
cd $( cygpath -u $GITHUB_WORKSPACE )
- name: CPAN log
if: ${{ failure() }}
run: |
cat ~/.cpanm/latest-build/build.log
weird-perls:
runs-on: "ubuntu-latest"
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
strategy:
matrix:
weirdness: [ 'uselongdouble', 'usequadmath' ]
name: Perl with ${{ matrix.weirdness }}
steps:
- uses: actions/checkout@v4
- name: Build perl ...
run: |
curl -L https://install.perlbrew.pl | bash
source ~/perl5/perlbrew/etc/bashrc
perlbrew install --notest -D ${{ matrix.weirdness }} perl-5.40.0 --as perl-5.40.0-${{ matrix.weirdness }} || (cat ~/perl5/perlbrew/build.perl-5.40.0.log; false)
- name: run tests
env:
PERL_USE_UNSAFE_INC: 0
HARNESS_OPTIONS: j4
MAKEFLAGS: --jobs=4
run: |
source ~/perl5/perlbrew/etc/bashrc
perlbrew switch perl-5.32.0-${{ matrix.weirdness }}
perlbrew install-cpanm
perl -V|grep archname
(cpanm -n ExtUtils::MakeMaker Devel::CheckLib File::Which && cpanm -n --installdeps .) || ( cat ~/.cpanm/build.log && false )
perl Makefile.PL
make coretest
make test
build-status:
runs-on: ubuntu-latest
continue-on-error: true
if: ${{ always() }}
needs: [ 'ci', 'cygwin', 'weird-perls' ] # , 'ci-ubuntu-containers'
steps:
- uses: PDLPorters/devops/github-actions/irc-notifications@master
with:
target-build-status: true
needs: ${{ toJSON(needs) }}