forked from PDLPorters/pdl
-
Notifications
You must be signed in to change notification settings - Fork 0
164 lines (160 loc) · 6 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
name: perl
on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:
jobs:
ci-32bit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
container: ['i386/perl:5.38']
steps:
- uses: actions/checkout@v4
- name: 32-bit CI
env:
HARNESS_OPTIONS: j4
run: |
docker run --rm -v "$(pwd):/pdl" -w /pdl ${{ matrix.container }} \
sh -c 'uname -a; perl -V; \
export HARNESS_OPTIONS=j4 MAKEFLAGS=--jobs=4
(cpanm -n ExtUtils::MakeMaker Devel::CheckLib File::Which && cpanm -n --installdeps .) || ( cat ~/.cpanm/build.log && false ) && \
perl Makefile.PL && make --jobs=4 test'
ci:
runs-on: ${{ matrix.os }}
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
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@v4
- 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: 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 }}
weird-perls:
runs-on: "ubuntu-latest"
strategy:
matrix:
weirdness: [ 'uselongdouble', 'usequadmath' ]
name: Perl with ${{ matrix.weirdness }}
steps:
- uses: actions/checkout@v4
- uses: Chocobo1/setup-ccache-action@v1
with:
override_cache_key: ccache-v0.0-ubuntu-${{ matrix.weirdness }}
- name: Build perl ...
env:
MAKEFLAGS: --jobs=4
run: |
sudo apt-get update && sudo apt-get install perlbrew
perlbrew init
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.40.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', 'ci-32bit', 'weird-perls' ]
steps:
- uses: PDLPorters/devops/github-actions/irc-notifications@master
with:
target-build-status: true
needs: ${{ toJSON(needs) }}