-
Notifications
You must be signed in to change notification settings - Fork 27
171 lines (154 loc) · 5.94 KB
/
Copy pathci.yml
File metadata and controls
171 lines (154 loc) · 5.94 KB
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
# SPDX-FileCopyrightText: 1996- European Centre for Medium-Range Weather Forecasts (ECMWF)
# SPDX-License-Identifier: Apache-2.0
name: CI
on:
push:
branches: [develop, master]
pull_request:
types: [opened, reopened, synchronize, labeled]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
ARTIFACT_POLL_INTERVAL: ${{ vars.ARTIFACT_POLL_INTERVAL || '60' }}
ARTIFACT_S3_ENDPOINT: ${{ secrets.ARTIFACT_S3_ENDPOINT }}
ARTIFACT_S3_BUCKET: ${{ secrets.ARTIFACT_S3_BUCKET }}
SCCACHE_BUCKET: ${{ secrets.SCCACHE_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
permissions:
contents: read
jobs:
ci-approval:
runs-on: ubuntu-slim
permissions:
pull-requests: write
steps:
- uses: ecmwf/ci-infrastructure/actions/require-ci-approval@main
pre-commit:
needs: ci-approval
runs-on: ubuntu-slim
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
steps:
- uses: actions/checkout@v6
- uses: ecmwf/ci-infrastructure/actions/pre-commit@main
resolve:
needs: [ci-approval, pre-commit]
runs-on: arc-runner-normal
container:
image: eccr.ecmwf.int/public-ci-images/ubuntu24.04-base:latest
outputs:
build-matrix: ${{ steps.r.outputs.matrix-build }}
build-hpc-matrix: ${{ steps.r.outputs.matrix-build-hpc }}
steps:
- name: Announce image
uses: ecmwf/ci-infrastructure/actions/announce-image@main
- id: mint
uses: actions/create-github-app-token@v3
with:
client-id: ${{ secrets.CI_PERMISSIONS_APP_CLIENT_ID }}
private-key: ${{ secrets.CI_PERMISSIONS_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- uses: actions/checkout@v6
- id: r
uses: ecmwf/ci-infrastructure/actions/resolve-deps@main
with:
matrix: build,build-hpc
token: ${{ steps.mint.outputs.token }}
client-id: ${{ secrets.CI_PERMISSIONS_APP_CLIENT_ID }}
app-private-key: ${{ secrets.CI_PERMISSIONS_APP_PRIVATE_KEY }}
build:
needs: [ci-approval, resolve]
name: build+test (${{ matrix._resolved['job-name'] }})
runs-on: ${{ matrix['runs-on'] }}
container:
image: ${{ matrix.container || '' }}
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.resolve.outputs.build-matrix) }}
steps:
- name: Announce image
uses: ecmwf/ci-infrastructure/actions/announce-image@main
- id: mint
uses: actions/create-github-app-token@v3
with:
client-id: ${{ secrets.CI_PERMISSIONS_APP_CLIENT_ID }}
private-key: ${{ secrets.CI_PERMISSIONS_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- uses: actions/checkout@v6
- name: Fetch resolved deps
id: deps
uses: ecmwf/ci-infrastructure/actions/fetch-deps@main
with:
deps-json: ${{ toJSON(matrix._resolved.deps) }}
token: ${{ steps.mint.outputs.token }}
- name: Build eckit
id: build
uses: ecmwf/ci-infrastructure/actions/run-job-script@main
with:
job-script: ${{ matrix.job-script }}
matrix-leg: ${{ toJSON(matrix) }}
package: eckit
cmake-prefix-path: ${{ steps.deps.outputs.cmake-prefix-path }}
- name: Publish eckit
uses: ecmwf/ci-infrastructure/actions/publish-artifact@main
with:
install-path: ${{ steps.build.outputs.install-path }}
artifact-name: ${{ matrix._resolved.own-artifact-name }}
- name: Print dependency table
if: always()
uses: ecmwf/ci-infrastructure/actions/print-dep-table@main
with:
resolved: ${{ toJSON(matrix._resolved) }}
build-hpc:
needs: [ci-approval, resolve]
name: build-hpc (${{ matrix._resolved['job-name'] }})
runs-on: ${{ matrix['runs-on'] }}
container:
image: ${{ matrix.container }}
credentials:
username: ${{ secrets.ECCR_PULL_ROBOT_NAME }}
password: ${{ secrets.ECCR_PULL_ROBOT_TOKEN }}
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.resolve.outputs.build-hpc-matrix) }}
steps:
- name: Announce image
uses: ecmwf/ci-infrastructure/actions/announce-image@main
- id: mint
uses: actions/create-github-app-token@v3
with:
client-id: ${{ secrets.CI_PERMISSIONS_APP_CLIENT_ID }}
private-key: ${{ secrets.CI_PERMISSIONS_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- uses: actions/checkout@v6
- name: Fetch resolved deps
id: deps
uses: ecmwf/ci-infrastructure/actions/fetch-deps@main
with:
deps-json: ${{ toJSON(matrix._resolved.deps) }}
token: ${{ steps.mint.outputs.token }}
# Stage the dep prefixes for shipment without installing anything
# here: they are consumed on the compute node, not in this container.
install-python-deps: 'false'
- name: Build eckit on HPC
id: build
uses: ecmwf/ci-infrastructure/actions/build-on-hpc@main
with:
site: ${{ matrix.site }}
job-script: ${{ matrix.job-script }}
# The render context for the .j2 recipe: the toolchain this leg declares.
matrix-leg: ${{ toJSON(matrix) }}
artifact-name: ${{ matrix._resolved.own-artifact-name }}
cmake-prefix-path: ${{ steps.deps.outputs.cmake-prefix-path }}
work-dir: ${{ vars.HPC_CI_WORK_DIR }}
remote-work-dir: ${{ vars.HPC_CI_REMOTE_WORK_DIR }}
troika-user: ${{ secrets.HPC_CI_SSH_USER }}
- name: Print dependency table
if: always()
uses: ecmwf/ci-infrastructure/actions/print-dep-table@main
with:
resolved: ${{ toJSON(matrix._resolved) }}
own-source: ${{ steps.build.outputs.cache-hit == 'true' && 'artifact' || 'built' }}