-
Notifications
You must be signed in to change notification settings - Fork 9
260 lines (251 loc) · 8.18 KB
/
build-and-test.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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
name: Build and test installer
on:
push:
# Only build for pushes to branches
branches:
- main
tags-ignore:
- '**'
pull_request:
branches:
- main
schedule:
- cron: '6 2 * * *'
workflow_dispatch:
jobs:
build-installer:
name: Build installer
if: github.repository == 'DIRACGrid/DIRACOS2'
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
target_arch: ["linux-64", "linux-aarch64", "linux-ppc64le", "osx-arm64", "osx-64"]
steps:
- uses: actions/checkout@v3
- id: get-date
run: echo "year-and-week=$(date +"%Y-W%U")" >> $GITHUB_OUTPUT
shell: bash
- name: Keep constructor cache between invocations
# This is big help to avoid needing to transmuting packages every time
id: cache-transmuted-packages
uses: actions/cache@v3
with:
path: ~/.conda/constructor
key: ${{ runner.os }}-${{ matrix.target_arch }}-constructor-${{ steps.get-date.outputs.year-and-week }}
- name: Prepare environment
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: scripts/environment.yml
miniforge-variant: Mambaforge
use-mamba: true
- name: Create installer
run: |
CONDA_SUBDIR=${{ matrix.target_arch }} mamba create --name constructor-${{ matrix.target_arch }} 'micromamba>=0.22'
CONDA_STANDALONE_PATH="$(conda info --envs | grep constructor-${{ matrix.target_arch }} | sed -E 's@([^ ]+ +)@@g')/bin/micromamba"
pip install git+http://github.com/conda/constructor.git@3.3.1
if [ "${{ matrix.target_arch }}" = osx-64 ]; then
export CONDA_OVERRIDE_OSX=10.12
elif [ "${{ matrix.target_arch }}" = linux-64 ]; then
export CONDA_OVERRIDE_GLIBC=2.17
fi
CONDA_SUBDIR=${{ matrix.target_arch }} constructor . --platform="${{ matrix.target_arch }}" --conda-exe="${CONDA_STANDALONE_PATH}"
- name: Upload installer
uses: actions/upload-artifact@v3
with:
name: installer-${{ matrix.target_arch }}
path: DIRACOS-*.sh
get-info:
name: Create environment.yaml
if: github.repository == 'DIRACGrid/DIRACOS2'
needs: build-installer
runs-on: ubuntu-latest
strategy:
matrix:
target_arch: ["linux-64"]
steps:
- name: Download installer
uses: actions/download-artifact@v3
with:
name: installer-${{ matrix.target_arch }}
- name: Generate environment.yaml
run: |
bash DIRACOS-*.sh
source diracos/diracosrc
conda env export --file environment.yaml --prefix $DIRACOS
- name: Upload environment.yaml
uses: actions/upload-artifact@v3
with:
name: environment-yaml-${{ matrix.target_arch }}
path: |
environment.yaml
release-notes:
name: Show release notes and diff
if: github.repository == 'DIRACGrid/DIRACOS2'
needs: get-info
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Prepare environment
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: scripts/environment.yml
miniforge-variant: Mambaforge
use-mamba: true
- name: Create release notes
run: |
scripts/make_release.py \
--token="${{ secrets.GITHUB_TOKEN }}" \
--artifacts-dir="${PWD}/artifacts" \
> release-notes.md
cat release-notes.md
- name: Upload release-notes.md
uses: actions/upload-artifact@v3
with:
name: release-notes
path: |
release-notes.md
basic-tests:
name: Basic tests
if: github.repository == 'DIRACGrid/DIRACOS2'
needs: build-installer
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
docker-image:
- "centos:7"
- "centos:8"
steps:
- uses: actions/checkout@v3
- name: Download installer
uses: actions/download-artifact@v3
with:
name: installer-linux-64
- name: Run tests
run: scripts/run_basic_tests.sh ${{ matrix.docker-image }} DIRACOS-*.sh
macos-tests:
name: macOS tests
if: github.repository == 'DIRACGrid/DIRACOS2'
needs: build-installer
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-11, macos-12]
steps:
- uses: actions/checkout@v3
- name: Download installer
uses: actions/download-artifact@v3
with:
name: installer-osx-64
- name: Run tests
run: |
bash DIRACOS-*.sh
set -x
source diracos/diracosrc
pip install DIRAC
integration-tests-client-only:
name: Integration tests (Py2 server)
if: github.repository == 'DIRACGrid/DIRACOS2'
needs: build-installer
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dirac-branch:
- rel-v7r3
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Download installer
uses: actions/download-artifact@v3
with:
name: installer-linux-64
- name: Prepare environment
run: |
pip install typer pyyaml gitpython packaging
git clone https://github.com/DIRACGrid/DIRAC.git -b "${{ matrix.dirac-branch }}" DIRACRepo
- name: Run tests
run: |
CLIENT_DIRACOS_TARBALL_PATH=$(echo ${PWD}/DIRACOS-*.sh)
echo "CLIENT_DIRACOS_TARBALL_PATH is ${CLIENT_DIRACOS_TARBALL_PATH}"
cd DIRACRepo
./integration_tests.py create \
"CLIENT_DIRACOS_TARBALL_PATH=${CLIENT_DIRACOS_TARBALL_PATH}" \
"CLIENT_USE_PYTHON3=Yes"
# This is duplicated as USE_PYTHON3=Yes is needed for rel-v7r3
# As soon as support for rel-v7r3 is dropped this job can be removed
integration-tests-client-and-server-v7r3:
name: Integration tests (Py3 server)
if: github.repository == 'DIRACGrid/DIRACOS2'
needs: build-installer
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dirac-branch:
- rel-v7r3
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Download installer
uses: actions/download-artifact@v3
with:
name: installer-linux-64
- name: Prepare environment
run: |
pip install typer pyyaml gitpython packaging
git clone https://github.com/DIRACGrid/DIRAC.git -b "${{ matrix.dirac-branch }}" DIRACRepo
- name: Run tests
run: |
DIRACOS_TARBALL_PATH=$(echo ${PWD}/DIRACOS-*.sh)
echo "DIRACOS_TARBALL_PATH is ${DIRACOS_TARBALL_PATH}"
cd DIRACRepo
./integration_tests.py create \
"DIRACOS_TARBALL_PATH=${DIRACOS_TARBALL_PATH}" \
"USE_PYTHON3=Yes"
integration-tests-client-and-server:
name: Integration tests (Py3 server)
if: github.repository == 'DIRACGrid/DIRACOS2'
needs: build-installer
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dirac-branch:
- rel-v8r0
- integration
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Download installer
uses: actions/download-artifact@v3
with:
name: installer-linux-64
- name: Prepare environment
run: |
pip install typer pyyaml gitpython packaging
git clone https://github.com/DIRACGrid/DIRAC.git -b "${{ matrix.dirac-branch }}" DIRACRepo
- name: Run tests
run: |
DIRACOS_TARBALL_PATH=$(echo ${PWD}/DIRACOS-*.sh)
echo "DIRACOS_TARBALL_PATH is ${DIRACOS_TARBALL_PATH}"
cd DIRACRepo
./integration_tests.py create \
"DIRACOS_TARBALL_PATH=${DIRACOS_TARBALL_PATH}"