-
Notifications
You must be signed in to change notification settings - Fork 147
258 lines (226 loc) · 11 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
# This job is the main jobs will dispatch build and test for every modules of our mono repo.
name: Main
on:
pull_request:
push:
branches:
- 'main'
- 'release/*'
tags:
- 'v[0-9]+.*'
schedule:
# Nightly Release @ 3AM after each work day
- cron: "0 3 * * 2-6"
jobs:
# This jobs outputs for each modules of our mono-repo if it changed,
# in order to launch jobs only for the changed modules
file-change:
if: ${{ github.event_name != 'schedule' }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
outputs:
compiler: ${{ steps.compiler.outputs.any_changed }}
optimizer: ${{ steps.optimizer.outputs.any_changed }}
concrete-cpu: ${{ steps.concrete-cpu.outputs.any_changed }}
concrete-cpu-api: ${{ steps.concrete-cpu-api.outputs.any_changed }}
concrete-cuda-api: ${{ steps.concrete-cuda-api.outputs.any_changed }}
concrete-python: ${{ steps.concrete-python.outputs.any_changed }}
concrete-compiler-cpu-workflow: ${{ steps.concrete-compiler-cpu-workflow.outputs.any_changed }}
concrete-compiler-gpu-workflow: ${{ steps.concrete-compiler-gpu-workflow.outputs.any_changed }}
concrete-compiler-format-and-linting-workflow: ${{ steps.concrete-compiler-format-and-linting-workflow.outputs.any_changed }}
concrete-compiler-macos-workflow: ${{ steps.concrete-compiler-macos-workflow.outputs.any_changed }}
concrete-compiler-docker-images-workflow: ${{ steps.concrete-compiler-docker-images-workflow.outputs.any_changed }}
concrete-cpu-workflow: ${{ steps.concrete-cpu-workflow.outputs.any_changed }}
concrete-python-workflow: ${{ steps.concrete-python-workflow.outputs.any_changed }}
concrete-optimizer-workflow: ${{ steps.concrete-optimizer-workflow.outputs.any_changed }}
push-main: ${{ steps.github.outputs.push-main }}
steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.CONCRETE_ACTIONS_TOKEN }}
- name: Get changed files in the concrete-compiler directory
id: compiler
uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d
with:
files: compilers/concrete-compiler
- name: Get changed files for concrete-optimizer
id: optimizer
uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d
with:
files: |
compilers/concrete-optimizer
.github/workflows/optimizer.yml
- name: Get changed files in the concrete-cpu directory
id: concrete-cpu
uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d
with:
files: backends/concrete-cpu/implementation
- name: Get changed files in the concrete-python directory
id: concrete-python
uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d
with:
files: frontends/concrete-python
- name: Check if compiler_build_and_test_cpu workflow has changed
id: concrete-compiler-cpu-workflow
uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d
with:
files: ./.github/workflows/compiler_build_and_test_cpu.yml
- name: Check if compiler_build_and_test_gpu workflow has changed
id: concrete-compiler-gpu-workflow
uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d
with:
files: ./.github/workflows/compiler_build_and_test_gpu.yml
- name: Check if compiler_format_and_linting.yml workflow has changed
id: concrete-compiler-format-and-linting-workflow
uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d
with:
files: ./.github/workflows/compiler_format_and_linting.yml
- name: Check if compiler_macos_build_and_test workflow has changed
id: concrete-compiler-macos-workflow
uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d
with:
files: ./.github/workflows/compiler_macos_build_and_test.yml
- name: Check if compiler_publish_docker_images workflow has changed
id: concrete-compiler-docker-images-workflow
uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d
with:
files: ./.github/workflows/compiler_publish_docker_images.yml
- name: Check if concrete_cpu_test workflow has changed
id: concrete-cpu-workflow
uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d
with:
files: ./.github/workflows/concrete_cpu_test.yml
- name: Check if concrete_python_checks workflow has changed
id: concrete-python-workflow
uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d
with:
files: ./.github/workflows/concrete_python_checks.yml
- name: Check if optimizer workflow has changed
id: concrete-optimizer-workflow
uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d
with:
files: ./.github/workflows/optimizer.yml
- name: Get changed files in the concrete-cpu directory
id: concrete-cpu-api
uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d
with:
files: backends/concrete-cpu/implementation/include/
- name: Get changed files in the concrete-cuda directory
id: concrete-cuda-api
uses: tj-actions/changed-files@7a453ffa2eb31a7e84f3281f88ef6d774c4d807d
with:
files: backends/concrete-cuda/implementation/include/
- name: Set some github event outputs
id: github
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'release'))
run: echo "push-main=true" >> "$GITHUB_OUTPUT"
#################################################
# Compiler jobs #################################
compiler-compliance:
needs: file-change
if: needs.file-change.outputs.compiler == 'true' || needs.file-change.outputs.concrete-compiler-format-and-linting-workflow == 'true' || needs.file-change.outputs.push-main == 'true' || contains(github.ref, 'refs/tags/')
uses: ./.github/workflows/compiler_format_and_linting.yml
compiler-cpu-build:
needs: file-change
if: needs.file-change.outputs.compiler == 'true' || needs.file-change.outputs.concrete-cpu-api == 'true'|| needs.file-change.outputs.concrete-compiler-cpu-workflow == 'true' || needs.file-change.outputs.push-main == 'true' || contains(github.ref, 'refs/tags/')
uses: ./.github/workflows/start_slab.yml
secrets: inherit
with:
command: compiler-cpu-build
compiler-gpu-build:
needs: file-change
if: needs.file-change.outputs.compiler == 'true' || needs.file-change.outputs.concrete-cuda-api == 'true' || needs.file-change.outputs.concrete-compiler-gpu-workflow == 'true' || needs.file-change.outputs.push-main == 'true' || contains(github.ref, 'refs/tags/')
uses: ./.github/workflows/start_slab.yml
secrets: inherit
with:
command: compiler-gpu-build
compiler-macos-tests:
needs: file-change
if: needs.file-change.outputs.compiler == 'true' || needs.file-change.outputs.concrete-compiler-macos-workflow == 'true' || needs.file-change.outputs.push-main == 'true' || contains(github.ref, 'refs/tags/')
uses: ./.github/workflows/compiler_macos_build_and_test.yml
secrets: inherit
compiler-publish-docker-images:
needs: file-change
if: (needs.file-change.outputs.compiler == 'true' || needs.file-change.outputs.concrete-compiler-docker-images-workflow == 'true') && (needs.file-change.outputs.push-main == 'true' || contains(github.ref, 'refs/tags/'))
uses: ./.github/workflows/start_slab.yml
secrets: inherit
with:
command: compiler-publish-docker-images
compiler-cpu-benchmark:
needs: file-change
if: needs.file-change.outputs.push-main == 'true'
uses: ./.github/workflows/start_slab.yml
secrets: inherit
with:
command: compiler-cpu-benchmark
compiler-gpu-benchmark:
needs: file-change
if: needs.file-change.outputs.push-main == 'true'
uses: ./.github/workflows/start_slab.yml
secrets: inherit
with:
command: compiler-gpu-benchmark
#################################################
# Optimizer jobs ################################
optimizer:
needs: file-change
if: |
needs.file-change.outputs.parameters-curves == 'true' ||
needs.file-change.outputs.concrete-cpu == 'true' ||
needs.file-change.outputs.optimizer == 'true'||
needs.file-change.outputs.push-main
uses: ./.github/workflows/optimizer.yml
secrets: inherit
#################################################
# ConcreteCPU jobs ##############################
concrete-cpu:
needs: file-change
if: needs.file-change.outputs.concrete-cpu == 'true' || needs.file-change.outputs.concrete-cpu-workflow == 'true' || needs.file-change.outputs.push-main
uses: ./.github/workflows/concrete_cpu_test.yml
secrets: inherit
#################################################
# Concrete Python jobs ##########################
concrete-python:
needs: file-change
if: needs.file-change.outputs.concrete-python == 'true' || needs.file-change.outputs.concrete-python-workflow == 'true' || needs.file-change.outputs.push-main || contains(github.ref, 'refs/tags/')
uses: ./.github/workflows/concrete_python_checks.yml
secrets: inherit
concrete-python-tests-linux:
needs: file-change
if: needs.file-change.outputs.concrete-python == 'true' || needs.file-change.outputs.push-main || contains(github.ref, 'refs/tags/')
uses: ./.github/workflows/start_slab.yml
secrets: inherit
with:
command: concrete-python-tests-linux
concrete-python-tests-macos:
needs: file-change
if: needs.file-change.outputs.concrete-python == 'true' || needs.file-change.outputs.push-main || contains(github.ref, 'refs/tags/')
uses: ./.github/workflows/concrete_python_test_macos.yml
secrets: inherit
#################################################
# Release jobs #################################
concrete-python-nightly-release:
if: ${{ github.event_name == 'schedule' }}
uses: ./.github/workflows/start_slab.yml
secrets: inherit
with:
command: concrete-python-release
user_inputs: 'nightly'
concrete-python-public-release:
# needs: [compiler-cpu-build, compiler-macos-tests, compiler-publish-docker-images, concrete-python-tests-linux, concrete-python-tests-macos]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: ./.github/workflows/start_slab.yml
secrets: inherit
with:
command: concrete-python-release
user_inputs: 'public'
concrete-python-docker-release:
needs: [concrete-python-public-release]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: ./.github/workflows/concrete_python_push_docker_image.yml
secrets: inherit
with:
tag: ${{ github.ref_name }}