-
Notifications
You must be signed in to change notification settings - Fork 2
231 lines (230 loc) · 7.23 KB
/
actions.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
name: linux-build-dist
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
workflow_dispatch:
jobs:
build-perls:
runs-on: ${{ matrix.os }}
strategy:
matrix:
perl: [40, 38, 36, 34, 32]
os: [ubuntu-latest, macos-latest]
# include:
# - os: macos-latest
# - perl: 34
steps:
- uses: actions/checkout@v4
- name: set environment variables
env:
PERL_NAME: perl-5.${{ matrix.perl }}.0
GHA_OS: ${{ matrix.os }}
PERL_DIR: ~/perl/${{ runner.os }}/5.${{ matrix.perl }}
run: |
./.github/scripts/set_environment_variables.sh
- name: perl cache
env:
CACHE_KEY: ${{ runner.os }}-perl2-${{ matrix.perl }}
id: cache-perl
uses: actions/cache@v4
with:
path: ${{ env.PERL_DIR }}
key: ${{ env.CACHE_KEY }}
- name: install perl
if: steps.cache-perl.outputs.cache-hit != 'true'
run: |
./.github/scripts/install_perl.sh
build-gsl:
runs-on: ${{ matrix.os }}
strategy:
matrix:
gsl: [2.8, 2.7, 2.6, 2.5, 2.4, 2.3]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: set environment variables
env:
GSL_NAME: gsl-${{ matrix.gsl }}
GSL_DIR: ~/gsl/${{ runner.os }}/gsl-${{ matrix.gsl }}
run: |
./.github/scripts/set_environment_variables.sh
- name: gsl cache
env:
CACHE_KEY: ${{ runner.os }}-gsl4-${{ matrix.gsl }}
id: cache-gsl
uses: actions/cache@v4
with:
path: ${{ env.GSL_DIR }}
key: ${{ env.CACHE_KEY }}
- name: install gsl
if: steps.cache-gsl.outputs.cache-hit != 'true'
run: |
./.github/scripts/install_gsl.sh
build-dist:
runs-on: ${{ matrix.os }}
needs: [build-gsl, build-perls]
strategy:
matrix:
gsl: [2.8]
perl: [40]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: set environment variables
env:
GSL_NAME: gsl-${{ matrix.gsl }}
GSL_DIR: ~/gsl/${{ runner.os }}/gsl-${{ matrix.gsl }}
PERL_NAME: perl-5.${{ matrix.perl }}.0
PERL_DIR: ~/perl/${{ runner.os }}/5.${{ matrix.perl }}
run: |
./.github/scripts/set_environment_variables.sh
- name: perl cache
env:
CACHE_KEY: ${{ runner.os }}-perl2-${{ matrix.perl }}
id: cache-perl
uses: actions/cache@v4
with:
path: ${{ env.PERL_DIR }}
key: ${{ env.CACHE_KEY }}
- name: gsl cache
env:
CACHE_KEY: ${{ runner.os }}-gsl4-${{ matrix.gsl }}
id: cache-gsl
uses: actions/cache@v4
with:
path: ${{ env.GSL_DIR }}
key: ${{ env.CACHE_KEY }}
- name: install packages
run: |
# NOTE: The following packages are already installed in "ubuntu-latest" :
# build-essential curl g++ git wget libssl-dev libz-dev
# swig autoconf libtool
#sudo apt-get install swig autoconf libtool
swig -version
- name: install perl modules, build, and test
run: |
./.github/scripts/build_and_test.sh
- name: build dist
run: |
./.github/scripts/build_dist.sh
- name: Save dist as artifact
uses: actions/upload-artifact@v3
with:
name: math_gsl_dist
path: ${{ env.MATH_GSL_DISTNAME }}
- name: Save name of dist as artifact
uses: actions/upload-artifact@v3
with:
name: math_gsl_dist_name
path: math-gsl-dist-name.txt
install-dist-linux:
runs-on: ubuntu-latest
needs: [build-dist]
strategy:
fail-fast: false
matrix:
gsl: [2.8, 2.7, 2.6, 2.5, 2.4, 2.3]
perl: [40, 38, 36, 34, 32]
steps:
- uses: actions/checkout@v4
- name: set environment variables
env:
GSL_NAME: gsl-${{ matrix.gsl }}
GSL_DIR: ~/gsl/${{ runner.os }}/gsl-${{ matrix.gsl }}
PERL_NAME: perl-5.${{ matrix.perl }}.0
PERL_DIR: ~/perl/${{ runner.os }}/5.${{ matrix.perl }}
run: |
./.github/scripts/set_environment_variables.sh
- name: perl cache
env:
CACHE_KEY: ${{ runner.os }}-perl2-${{ matrix.perl }}
id: cache-perl
uses: actions/cache@v4
with:
path: ${{ env.PERL_DIR }}
key: ${{ env.CACHE_KEY }}
- name: gsl cache
env:
CACHE_KEY: ${{ runner.os }}-gsl4-${{ matrix.gsl }}
id: cache-gsl
uses: actions/cache@v4
with:
path: ${{ env.GSL_DIR }}
key: ${{ env.CACHE_KEY }}
- name: Download dist
env:
PERL_NAME: perl-5.${{ matrix.perl }}
PERL_DIR: ~/perl/${{runner.os}}/5.${{ matrix.perl }}
GSL_NAME: gsl-${{ matrix.gsl }}
GSL_DIR: ~/gsl/${{runner.os}}/gsl-${{ matrix.gsl }}
uses: actions/download-artifact@v3
with:
name: math_gsl_dist
- name: Download dist name
uses: actions/download-artifact@v3
with:
name: math_gsl_dist_name
- name: extract dist
run: |
DISTNAME=$(<math-gsl-dist-name.txt)
tar zxvf $DISTNAME
DISTDIR=$(perl -pe 's/\.tar.gz$//' <<<"$DISTNAME")
echo "DISTDIR=$DISTDIR" >> $GITHUB_ENV
- name: install perl modules and build and test
run: |
BASEDIR=$PWD
cd $DISTDIR
$BASEDIR/.github/scripts/build_and_test.sh
install-dist-macos:
runs-on: macos-latest
needs: [build-dist]
strategy:
fail-fast: false
matrix:
perl: [40, 38, 36]
#gsl: [2.7, 2.6]
# NOTE: on macos we will not build against a pre-installed gsl, this will cause
# Build.PL to download the latest gsl version from the internet instead
steps:
- uses: actions/checkout@v4
- name: set environment variables
env:
PERL_NAME: perl-5.${{ matrix.perl }}.0
PERL_DIR: ~/perl/${{ runner.os }}/5.${{ matrix.perl }}
run: |
./.github/scripts/set_environment_variables.sh
- name: perl cache
env:
CACHE_KEY: ${{ runner.os }}-perl2-${{ matrix.perl }}
id: cache-perl
uses: actions/cache@v4
with:
path: ${{ env.PERL_DIR }}
key: ${{ env.CACHE_KEY }}
- name: Download dist
env:
PERL_NAME: perl-5.${{ matrix.perl }}
PERL_DIR: ~/perl/${{runner.os}}/5.${{ matrix.perl }}
uses: actions/download-artifact@v3
with:
name: math_gsl_dist
- name: Download dist name
uses: actions/download-artifact@v3
with:
name: math_gsl_dist_name
- name: extract dist
run: |
DISTNAME=$(<math-gsl-dist-name.txt)
tar zxvf $DISTNAME
DISTDIR=$(perl -pe 's/\.tar.gz$//' <<<"$DISTNAME")
echo "DISTDIR=$DISTDIR" >> $GITHUB_ENV
- name: install perl modules and build and test
# NOTE: This should first download and install libgsl using the Alien::GSL module
run: |
BASEDIR=$PWD
cd $DISTDIR
$BASEDIR/.github/scripts/build_and_test.sh