-
Notifications
You must be signed in to change notification settings - Fork 8
280 lines (275 loc) · 10.1 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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
name: Build and test for Intel / ARM
run-name: Generate the Template SIMD Library, builds it and run tests
on:
pull_request:
branches:
- main
types: [opened, synchronize, reopened, edited]
jobs:
setup-generation:
name: Setup Environment for Generation
uses: ./.github/workflows/setup-environment.yml
with:
requirement-file: "requirements.txt"
docker-tag: "${{ vars.GENERATION_TAG }}"
context: ".github/actions/tsl-generate"
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
setup-x86:
name: Setup Environment for x86
uses: ./.github/workflows/setup-environment.yml
with:
requirement-file: "requirements.txt"
docker-tag: "${{ vars.BUILD_TEST_x86_TAG }}"
context: ".github/actions/tsl-test-x86"
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
setup-arm:
name: Setup Environment for ARM
uses: ./.github/workflows/setup-environment.yml
with:
requirement-file: "requirements.txt"
docker-tag: "${{ vars.BUILD_TEST_ARM_TAG }}"
context: ".github/actions/tsl-test-arm"
platforms: linux/amd64,linux/arm64
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
generate-for-x86:
runs-on: ubuntu-latest
needs: setup-generation
name: Generate TSL for Intel x86
strategy:
matrix:
target_flags:
- "sse"
- "sse,sse2"
- "sse,sse2,ssse3"
- "sse,sse2,ssse3,sse4_1"
- "sse,sse2,ssse3,sse4_1,sse4_2"
- "sse,sse2,ssse3,sse4_1,sse4_2,avx"
- "sse,sse2,ssse3,sse4_1,sse4_2,avx,avx2"
- "sse,sse2,ssse3,sse4_1,sse4_2,avx,avx2,avx512f"
- "sse,sse2,ssse3,sse4_1,sse4_2,avx,avx2,avx512f,avx512cd,avx512er,avx512pf" #avx3.1
- "sse,sse2,ssse3,sse4_1,sse4_2,avx,avx2,avx512f,avx512cd,avx512bw,avx512dq,avx512vl" #avx3.2
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout PR and merge
uses: check-spelling/[email protected]
- name: Cancel on Merge fail
if: env.MERGE_FAILED == '1'
run:
echo "Merge failed, c
- name: TSL Generate
id: generate
uses: ./.github/actions/tsl-generate
with:
# image: ${{ vars.GENERATION_TAG }}
targets: ${{ matrix.target_flags }}
- name: Upload Generated TSL
if: always()
uses: actions/upload-artifact@v4
with:
name: generate_tsl_x86_${{ steps.generate.outputs.name }}
path: ${{ github.workspace }}/${{ steps.generate.outputs.out }}
overwrite: true
retention-days: 1
- name: Output on Error
if: ${{ steps.generate.outputs.success == 'false' }}
run: |
echo "Generation for Intel x86 failed"
echo "${{ steps.generate.outputs.msg }}"
cat ${{ github.workspace }}/${{ steps.generate.outputs.out }}/${{ steps.generate.outputs.failout}}
touch ${{ github.workspace }}/intel_generation_failed
- name: Upload on Error
if: ${{ steps.generate.outputs.success == 'false' }}
uses: actions/upload-artifact@v4
with:
name: intel_generation_failed
path: ${{ github.workspace }}
retention-days: 1
- name: Fail on Error
if: ${{ steps.generate.outputs.success == 'false' }}
run: exit 1
build-and-test-for-x86:
runs-on: ubuntu-latest
needs: [setup-x86, generate-for-x86]
name: Build and test TSL for Intel x86
strategy:
matrix:
compilers: ["clang++-17", "g++"]
tsl_folders:
- "sse"
- "sse-sse2"
- "sse-sse2-ssse3"
- "sse-sse2-ssse3-sse4_1"
- "sse-sse2-ssse3-sse4_1-sse4_2"
- "sse-sse2-ssse3-sse4_1-sse4_2-avx"
- "sse-sse2-ssse3-sse4_1-sse4_2-avx-avx2"
- "sse-sse2-ssse3-sse4_1-sse4_2-avx-avx2-avx512f"
- "sse-sse2-ssse3-sse4_1-sse4_2-avx-avx2-avx512f-avx512cd-avx512er-avx512pf" #avx3.1
- "sse-sse2-ssse3-sse4_1-sse4_2-avx-avx2-avx512f-avx512cd-avx512bw-avx512dq-avx512vl" #avx3.2
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout PR and merge
uses: check-spelling/[email protected]
- name: Download Generated TSL
uses: actions/download-artifact@v4
with:
name: generate_tsl_x86_${{ matrix.tsl_folders }}
path: ${{ github.workspace }}/generate/${{ matrix.tsl_folders }}
- name: TSL Build and Test
id: bat
uses: ./.github/actions/tsl-test-x86
with:
# image: ${{ vars.BUILD_TEST_X86_TAG }}
compiler: ${{ matrix.compilers }}
tsl: generate/${{ matrix.tsl_folders }}
- name: Upload Generated TSL
if: always()
uses: actions/upload-artifact@v4
with:
name: build_tsl_x86_${{ matrix.compilers }}_${{ matrix.tsl_folders }}
path: ${{ github.workspace }}/generate/${{ matrix.tsl_folders }}
overwrite: true
retention-days: 1
- name: Output on Error
if: ${{ steps.bat.outputs.success == 'false' }}
run: |
echo "Build (with ${{ matrix.compilers }}, ${{ matrix.tsl_folders }}) and testing for Intel x86 failed"
echo "${{ steps.bat.outputs.msg }}"
cat ${{ github.workspace }}/${{ steps.bat.outputs.out }}/${{ steps.generate.bat.failout}}
touch ${{ github.workspace }}/intel_bat_failed
- name: Upload on Error
if: ${{ steps.bat.outputs.success == 'false' }}
uses: actions/upload-artifact@v4
with:
name: intel_bat_failed
path: ${{ github.workspace }}
retention-days: 1
- name: Fail on Error
if: ${{ steps.bat.outputs.success == 'false' }}
run: exit 1
generate-for-arm:
runs-on: ubuntu-latest
needs: setup-generation
name: Generate TSL for ARM
strategy:
matrix:
target_flags:
- "neon"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout PR and merge
uses: check-spelling/[email protected]
- name: TSL Generate
id: generate
uses: ./.github/actions/tsl-generate
with:
# image: ${{ vars.GENERATION_TAG }}
targets: ${{ matrix.target_flags }}
- name: Upload Generated TSL
if: always()
uses: actions/upload-artifact@v4
with:
name: generate_tsl_arm_${{ steps.generate.outputs.name }}
path: ${{ github.workspace }}/${{ steps.generate.outputs.out }}
overwrite: true
retention-days: 1
- name: Output on Error
if: ${{ steps.generate.outputs.success == 'false' }}
run: |
echo "Generation for ARM failed"
echo "${{ steps.generate.outputs.msg }}"
cat ${{ github.workspace }}/${{ steps.generate.outputs.out }}/${{ steps.generate.outputs.failout}}
touch ${{ github.workspace }}/arm_generation_failed
- name: Upload on Error
if: ${{ steps.generate.outputs.success == 'false' }}
uses: actions/upload-artifact@v4
with:
name: arm_generation_failed
path: ${{ github.workspace }}
retention-days: 1
- name: Fail on Error
if: ${{ steps.generate.outputs.success == 'false' }}
run: exit 1
build-and-test-for-arm:
runs-on: ubuntu-latest
name: Package TSL for ARM
needs: [setup-arm, generate-for-arm]
strategy:
matrix:
compilers: ["g++"]
tsl_folders:
- "neon"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout PR and merge
uses: check-spelling/[email protected]
- name: Download Generated TSL
uses: actions/download-artifact@v4
with:
name: generate_tsl_arm_${{ matrix.tsl_folders }}
path: ${{ github.workspace }}/generate/${{ matrix.tsl_folders }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: TSL Build and Test
id: bat
uses: ./.github/actions/tsl-test-arm
with:
compiler: ${{ matrix.compilers }}
tsl: generate/${{ matrix.tsl_folders }}
- name: Upload Generated TSL
if: always()
uses: actions/upload-artifact@v4
with:
name: build_tsl_arm_${{ matrix.compilers }}_${{ matrix.tsl_folders }}
path: ${{ github.workspace }}/generate/${{ matrix.tsl_folders }}
overwrite: true
retention-days: 1
- name: Output on Error
if: ${{ steps.bat.outputs.success == 'false' }}
run: |
echo "Build (with ${{ matrix.compilers }}, ${{ matrix.tsl_folders }}) and testing for ARM failed"
echo "${{ steps.bat.outputs.msg }}"
cat ${{ github.workspace }}/${{ steps.bat.outputs.out }}/${{ steps.bat.outputs.failout}}
touch ${{ github.workspace }}/arm_bat_failed
- name: Upload on Error
if: ${{ steps.bat.outputs.success == 'false' }}
uses: actions/upload-artifact@v4
with:
name: arm_bat_failed
path: ${{ github.workspace }}
retention-days: 1
- name: Fail on Error
if: ${{ steps.bat.outputs.success == 'false' }}
run: exit 1
package-results:
runs-on: ubuntu-latest
needs: [build-and-test-for-x86, build-and-test-for-arm]
name: Package Results
steps:
- name: Download Generated TSL
uses: actions/download-artifact@v4
with:
pattern: generate_tsl*
path: ${{ github.workspace }}/build_and_test_pipe/generated
- name: Download Built TSL
uses: actions/download-artifact@v4
with:
pattern: build_tsl*
path: ${{ github.workspace }}/build_and_test_pipe/build
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Results
path: ${{ github.workspace }}/build_and_test_pipe/
overwrite: true