-
Notifications
You must be signed in to change notification settings - Fork 50
261 lines (240 loc) · 8.2 KB
/
main.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
on: [pull_request, push, merge_group]
name: ci
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check-pr:
name: validate commits
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- run: git fetch origin master
- uses: flux-framework/pr-validator@master
spelling:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Check Spelling
uses: crate-ci/typos@bcafd462cb07ef7ba57e34abf458fe20767e808b # v1.19.0
python-lint:
name: python linting
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: install linting and formatting deps
run: pip install -r scripts/requirements-dev.txt
- name: format and linting checks
run: pre-commit run --all-files
check-sched:
needs: [python-lint]
name: flux-sched check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- run: git fetch --tags || true
- run: >
src/test/docker/docker-run-checks.sh --install-only \
--tag=fluxrm/flux-core:bookworm
- run: >
cd .. && git clone https://github.com/flux-framework/flux-sched &&
cd flux-sched &&
src/test/docker/docker-run-checks.sh -j 4 -i bookworm -- CXXFLAGS=-Wno-error=maybe-uninitialized
check-accounting:
needs: [python-lint]
name: flux-accounting check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- run: >
src/test/docker/docker-run-checks.sh --image=el8 --install-only \
--tag=fluxrm/flux-core:el8
- run: >
cd .. && git clone https://github.com/flux-framework/flux-accounting &&
cd flux-accounting && src/test/docker/docker-run-checks.sh -j 4
check-pmix:
needs: [python-lint]
name: flux-pmix check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- run: >
src/test/docker/docker-run-checks.sh
--image=el8
--install-only
--tag=fluxrm/flux-core:el8
- run: >
cd .. &&
git clone https://github.com/flux-framework/flux-pmix &&
cd flux-pmix &&
src/test/docker/docker-run-checks.sh -j 4 -i el8
--build-arg OMPI_BRANCH=v5.0.0rc12
--build-arg OPENPMIX_BRANCH=v4.2.3
check-pam:
needs: [python-lint]
name: flux-pam check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- run: >
src/test/docker/docker-run-checks.sh
--image=el8
--install-only
--tag=fluxrm/flux-core:el8
- run: >
cd .. &&
git clone https://github.com/flux-framework/flux-pam &&
cd flux-pam &&
src/test/docker/docker-run-checks.sh -j 4 -i el8
generate-matrix:
# https://stackoverflow.com/questions/59977364
name: Generate build matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- id: set-matrix
run: echo "matrix=$(src/test/generate-matrix.py)" >> $GITHUB_OUTPUT
- run: src/test/generate-matrix.py | jq -S .
- run: echo "GITHUB_BRANCH=${GITHUB_REF#refs/heads}" >> $GITHUB_OUTPUT
- run: echo "GITHUB_TAG=${GITHUB_REF#refs/tags}" >> $GITHUB_OUTPUT
- run: echo "EVENT_NAME=${{ github.event_name }}" >> $GITHUB_OUTPUT
ci-checks:
needs: [generate-matrix]
runs-on: ubuntu-latest
env:
TAP_DRIVER_QUIET: 1
FLUX_TEST_TIMEOUT: 300
DOCKER_REPO: fluxrm/flux-core
DOCKER_USERNAME: travisflux
DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_TRAVISFLUX_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
matrix: ${{fromJson(needs.generate-matrix.outputs.matrix)}}
fail-fast: false
name: ${{matrix.name}}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: fetch annotated tag
if: >
(matrix.create_release || matrix.docker_tag) &&
github.ref != 'refs/heads/master'
run: |
# Ensure git-describe works on a tag.
# (checkout@v4 action may have left current tag as
# lightweight instead of annotated. See
# https://github.com/actions/checkout/issues/290)
#
echo github.ref == ${{ github.ref }} ;
git fetch -f origin ${{ github.ref }}:${{ github.ref }} ;
echo git describe now reports $(git describe --always)
- name: coverage setup
env: ${{matrix.env}}
if: matrix.coverage
run: |
# Use python3 coverage to match version in flux docker image
sudo apt update ; \
sudo apt install -yy python3-pip ; \
pip3 install --upgrade pip ;
pip3 install --upgrade --force-reinstall coverage ;
- name: s3 setup
env: ${{matrix.env}}
if: matrix.test_s3
run: |
docker run -d -p 9000:9000 minio/minio server /data; \
- name: generate dumpfile from most recent flux-core tag
if: (matrix.create_release != true)
run: |
src/test/create-kvs-dumpfile.sh -d /tmp/dumpfile &&
if test -f /tmp/dumpfile/*.bz2; then
cp /tmp/dumpfile/*.tar.bz2 $(pwd)/t/job-manager/dumps/valid
fi
- name: docker buildx
uses: docker/setup-buildx-action@v3
if: matrix.needs_buildx
- name: setup qemu-user-static
run: |
docker run --rm --privileged aptman/qus -s -- -p --credential aarch64
- name: docker-run-checks
timeout-minutes: ${{matrix.timeout_minutes}}
env: ${{matrix.env}}
run: ${{matrix.command}}
- name: annotate errors
if: failure() || cancelled()
env: ${{matrix.env}}
run: src/test/checks-annotate.sh
- name: coverage report
if: success() && matrix.coverage
env:
DOCKER_REPO:
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{matrix.coverage_flags}}
- name: docker deploy
if: success() && matrix.docker_tag
env: ${{matrix.env}}
run: src/test/docker-deploy.sh
- name: create release
id: create_release
if: |
success()
&& matrix.create_release
&& github.repository == 'flux-framework/flux-core'
env: ${{matrix.env}}
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ matrix.tag }}
name: flux-core ${{ matrix.tag }}
prerelease: true
files: flux-core*.tar.gz
body: |
View [Release Notes](https://github.com/${{ github.repository }}/blob/${{ matrix.tag }}/NEWS.md) for flux-core ${{ matrix.tag }}
generate-manifest:
name: Generate docker manifest
runs-on: ubuntu-latest
needs: [ci-checks]
env:
DOCKER_REPO: fluxrm/flux-core
DOCKER_USERNAME: travisflux
DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_TRAVISFLUX_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: make and push manifest as fluxrm/flux-core
if: >
(startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master')
run: |
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker manifest create fluxrm/flux-core:bookworm fluxrm/flux-core:bookworm-amd64 fluxrm/flux-core:bookworm-386 fluxrm/flux-core:bookworm-arm64
docker manifest push fluxrm/flux-core:bookworm
for d in el9 noble alpine ; do
docker manifest create fluxrm/flux-core:$d fluxrm/flux-core:$d-amd64 fluxrm/flux-core:$d-arm64
docker manifest push fluxrm/flux-core:$d
done