-
Notifications
You must be signed in to change notification settings - Fork 53
278 lines (239 loc) · 7.81 KB
/
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
name: test
on:
push:
branches:
- master
- '2.*.x'
pull_request:
workflow_dispatch:
inputs:
rose_ref:
description: The Rose branch to test against
required: true
fcm_ref:
description: The FCM branch to test against
required: false
fcm_repo:
description: The FCM repo to test against
required: false
cylc_flow_tag:
description: The cylc-flow branch to test against
required: false
cylc_flow_repo:
description: The cylc-flow repo to test against
required: false
cylc_rose_tag:
description: The cylc-rose branch to test against
required: false
cylc_rose_repo:
description: The cylc-rose repo to test against
required: false
schedule:
- cron: '37 04 * * 1-5' # 03:37, Monday-Friday
defaults:
run:
shell: bash # macos default shell is zsh
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.rose_ref || github.sha }}
- name: Configure Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Apt-Get Install
run: |
sudo apt-get update
sudo apt-get install -y shellcheck
- name: Install Rose
run: |
pip install ."[lint]"
yarn install
- name: Flake8
run: flake8
- name: Shellchecker
run: etc/bin/shellchecker
- name: ESLint
run: yarn run lint
- name: MyPy
run: |
mypy
test:
needs: lint
runs-on: ${{ matrix.os }}
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest']
python-version: ['3.7', '3.8', '3.9']
include:
- os: 'macos-latest'
python-version: '3.8'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.rose_ref || github.sha }}
path: rose
- name: Configure Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Patch DNS
uses: cylc/release-actions/patch-dns@v1
- name: Brew Install
if: startsWith(matrix.os, 'macos')
run: |
# install system deps
brew install \
bash \
coreutils \
gnu-sed \
sqlite3 \
subversion
# add GNU coreutils and sed to the user PATH (for actions steps)
# (see instructions in brew install output)
echo "$(brew --prefix)/opt/coreutils/libexec/gnubin" >> "${GITHUB_PATH}"
echo "$(brew --prefix)/opt/gnu-sed/libexec/gnubin" >> "${GITHUB_PATH}"
# add GNU coreutils and sed to the user PATH (for Cylc jobs)
cat >> "$HOME/.bashrc" <<__HERE__
PATH="$(brew --prefix)/opt/coreutils/libexec/gnubin:$PATH"
PATH="$(brew --prefix)/opt/gnu-sed/libexec/gnubin:$PATH"
PATH="$pythonLocation:\$PATH"
export PATH
# see NOTE in t/rosie-lookup/00-basic.t
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
__HERE__
cat "$HOME/.bashrc"
- name: Configure git # Configure Git for Git dependent tests.
uses: cylc/release-actions/configure-git@v1
- name: Apt-Get Install
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y shellcheck sqlite3 at graphviz graphviz-dev
- name: Install Rose
working-directory: rose
run: |
pip install ."[tests,docs${{ (startsWith(matrix.os, 'ubuntu') && ',graph,rosa') || '' }}]"
yarn install
- name: Install Cylc
uses: cylc/release-actions/install-cylc-components@v1
with:
cylc_flow: true
cylc_flow_opts: ''
cylc_flow_repo: ${{ inputs.cylc_flow_repo || 'cylc/cylc-flow' }}
cylc_flow_tag: ${{ inputs.cylc_flow_tag }}
cylc_rose: true
cylc_rose_opts: ''
cylc_rose_repo: ${{ inputs.cylc_rose_repo || 'cylc/cylc-rose' }}
cylc_rose_tag: ${{ inputs.cylc_rose_tag }}
- name: Checkout FCM
if: startsWith(matrix.os, 'ubuntu')
uses: actions/checkout@v4
with:
repository: ${{ inputs.fcm_repo || 'metomi/fcm' }}
ref: ${{ inputs.fcm_ref || 'master' }}
path: 'fcm'
- name: Install FCM
if: startsWith(matrix.os, 'ubuntu')
run: |
# install FCM deps
sudo apt-get install -y \
subversion \
build-essential \
gfortran \
libxml-parser-perl \
libconfig-inifiles-perl \
libdbi-perl \
libdbd-sqlite3-perl
# install wandisco
sudo sh -c 'echo "deb http://opensource.wandisco.com/ubuntu \
`lsb_release -cs` svn19" \
>> /etc/apt/sources.list.d/subversion19.list'
sudo wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- \
| sudo apt-key add -
# prepend FCM bin to $PATH
FCM_PATH="$GITHUB_WORKSPACE/fcm/bin"
# the github actions way (needed for cylc jobs)
echo "$FCM_PATH" >> "${GITHUB_PATH}"
# the bashrc wat (needed for subsequent gh action steps)
echo "export PATH=\"$FCM_PATH:\$PATH\"" >> "$HOME/.bashrc"
- name: Unit Tests
working-directory: rose
run: |
pytest
- name: Functional Tests
timeout-minutes: 30
id: functest
working-directory: rose
env:
OBJC_DISABLE_INITIALIZE_FORK_SAFETY: YES
run: |
# rose tests should pass first time around
etc/bin/rose-test-battery -j 4 --state=save
- name: Re-Run Fails
if: failure() && steps.functest.outcome == 'failure'
working-directory: rose
env:
OBJC_DISABLE_INITIALIZE_FORK_SAFETY: YES
run: |
# so we only re-run for debug purposes
cylc scan --state=all --color=never
etc/bin/rose-test-battery -j 1 -v --state=save,failed
- name: Upload cylc-run artifact
if: failure() && steps.functest.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
name: cylc-run ${{ matrix.os }} py-${{ matrix.python-version }}
path: ~/cylc-run/
docs:
needs: lint
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.rose_ref || github.sha }}
- name: Configure Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: install graphviz
run: |
sudo apt-get update
sudo apt-get install -y graphviz pkg-config libgraphviz-dev
- name: Install Rose
run: |
pip install -e .[docs,graph]
- name: Install Cylc
uses: cylc/release-actions/install-cylc-components@v1
with:
cylc_flow: true
cylc_flow_opts: ''
cylc_flow_repo: ${{ inputs.cylc_flow_repo || 'cylc/cylc-flow' }}
cylc_flow_tag: ${{ inputs.cylc_flow_tag }}
cylc_rose: true
cylc_rose_opts: ''
cylc_rose_repo: ${{ inputs.cylc_rose_repo || 'cylc/cylc-rose' }}
cylc_rose_tag: ${{ inputs.cylc_rose_tag }}
- name: build (html)
run: |
make -C sphinx/ html SPHINXOPTS='-Wn'
# - name: build (slides)
# run: |
# make -C sphinx/ slides SPHINXOPTS='-Wn'
- name: build (linkcheck)
run: |
make -C sphinx/ linkcheck SPHINXOPTS='-Wn'
- name: debug
if: failure()
run: |
cat /tmp/sphinx-err* >&2 || true