-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild_test_release_eudsl_tile.yml
More file actions
332 lines (268 loc) · 9.81 KB
/
build_test_release_eudsl_tile.yml
File metadata and controls
332 lines (268 loc) · 9.81 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
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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Copyright (c) 2024.
name: "Build, test, release eudsl-tile"
on:
workflow_dispatch:
inputs:
force_debug_with_tmate:
type: boolean
description: 'Run the build with tmate session'
required: false
default: false
debug_with_tmate:
type: boolean
description: 'Run the build with a tmate session ONLY in case of failure'
required: false
default: false
workflow_call:
inputs:
wheel_version:
description: 'wheel version'
type: string
required: false
default: ''
workflow_call:
description: 'To distinguish workflow_call from regular push'
type: boolean
required: false
default: true
workflow_caller_run_id:
description: ''
type: string
required: false
default: ''
pull_request:
branches:
- main
paths:
- ".github/workflows/build_test_release_eudsl_tile.yml"
- "projects/eudsl-tile/**"
push:
branches:
- main
paths:
- ".github/workflows/build_test_release_eudsl_tile.yml"
- "projects/eudsl-tile/**"
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}-build_test_release_eudsl_tile
cancel-in-progress: true
jobs:
build-eudsl-tile:
strategy:
fail-fast: false
matrix:
include:
- name: "ubuntu_x86_64"
runs-on: "ubuntu-22.04"
os: "ubuntu"
host-arch: "x86_64"
target-arch: "x86_64"
- name: "ubuntu_aarch64"
runs-on: "ubuntu-22.04-arm"
os: "ubuntu"
host-arch: "aarch64"
target-arch: "aarch64"
- name: "windows_amd64"
runs-on: "windows-2022"
os: "windows"
host-arch: "amd64"
target-arch: "amd64"
- name: "macos_arm64"
runs-on: "macos-14"
os: "macos"
host-arch: "arm64"
target-arch: "arm64"
runs-on: ${{ matrix.runs-on }}
name: "Build eudsl-tile ${{ matrix.name }}"
defaults:
run:
shell: bash
permissions:
id-token: write
contents: write
env:
# either the PR number or `branch-N` where N always increments
cache-key: eudsl_tile_${{ matrix.name }}_clang_${{ format('{0}-{1}', github.ref_name, github.run_number) }}
steps:
- name: "Check out repository"
uses: actions/checkout@v4.2.2
with:
submodules: false
- name: "Get submodules"
run: git submodule update --init --depth=1
- name: "Setup base"
uses: ./.github/actions/setup_base
id: setup_base
with:
cache-key: ${{ env.cache-key }}
restore-key: "eudsl_tile_${{ matrix.name }}_clang"
os: ${{ matrix.os }}
host-arch: ${{ matrix.host-arch }}
target-arch: ${{ matrix.target-arch }}
runs-on: ${{ matrix.runs-on }}
- name: "Pip download MLIR from releases"
if: ${{ !inputs.workflow_call }}
run: |
pip download mlir-wheel -f https://llvm.github.io/eudsl
WHEEL_NAME=$(ls mlir_wheel*)
$python3_command -m pip install pkginfo
WHEEL_VERSION=$($python3_command -c "from pkginfo import Wheel; print(Wheel('$WHEEL_NAME').version)")
echo "WHEEL_VERSION=$WHEEL_VERSION" >> $GITHUB_ENV
- name: Download LLVM distro artifacts
if: ${{ inputs.workflow_call }}
uses: dawidd6/action-download-artifact@v11
with:
name: mlir_wheel_${{ (matrix.name == 'ubuntu_x86_64' || matrix.name == 'ubuntu_aarch64') && 'manylinux' || matrix.os }}_${{ matrix.target-arch }}_artifact
path: "./"
run_id: ${{ inputs.workflow_caller_run_id }}
- name: "Set WHEEL_VERSION env var"
if: ${{ inputs.workflow_call }}
run: |
echo "WHEEL_VERSION=${{ inputs.wheel_version }}" >> $GITHUB_ENV
- name: "Configure build"
run: |
unzip -q mlir_wheel*.whl
mv mlir_wheel llvm-install
if [[ "${{ matrix.os }}" == "ubuntu" ]]; then
echo "LLVM_DIR=/host/$PWD/llvm-install/lib/cmake/llvm" >> $GITHUB_ENV
echo "MLIR_DIR=/host/$PWD/llvm-install/lib/cmake/mlir" >> $GITHUB_ENV
echo "Clang_DIR=/host/$PWD/llvm-install/lib/cmake/clang" >> $GITHUB_ENV
echo "CMAKE_PREFIX_PATH=/host/$PWD/llvm-install" >> $GITHUB_ENV
else
echo "LLVM_DIR=$PWD/llvm-install/lib/cmake/llvm" >> $GITHUB_ENV
echo "MLIR_DIR=$PWD/llvm-install/lib/cmake/mlir" >> $GITHUB_ENV
echo "Clang_DIR=$PWD/llvm-install/lib/cmake/clang" >> $GITHUB_ENV
echo "CMAKE_PREFIX_PATH=$PWD/llvm-install" >> $GITHUB_ENV
fi
$python3_command -m pip install cibuildwheel
if [[ "${{ matrix.os }}" == "ubuntu" ]] && [[ "${{ matrix.host-arch }}" == "aarch64" ]]; then
sudo apt-get install libarchive-dev antlr libxml2-dev libxslt-dev libcurl4-openssl-dev
fi
if [[ "${{ matrix.os }}" == "macos" ]]; then
brew install antlr boost libarchive
fi
- name: "Build eudsl-tile"
run: |
# combine eudsl-python-extras and eudsl-tile
cp -R "$PWD/projects/eudsl-python-extras/mlir/extras" "$PWD/projects/eudsl-tile/eudsl-tile"
$python3_command -m cibuildwheel "$PWD/projects/eudsl-tile" --output-dir wheelhouse
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: eudsl_tile_${{ matrix.name }}_artifact
path: wheelhouse/*.whl
if-no-files-found: error
- name: "Setup tmate session"
if: (failure() && inputs.debug_with_tmate) || inputs.force_debug_with_tmate
uses: mxschmitt/action-tmate@v3.18
with:
limit-access-to-actor: true
install-dependencies: ${{ startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'windows') || startsWith(matrix.os, 'ubuntu') }}
test-eudsl-tile:
if: github.event_name == 'pull_request'
needs: [build-eudsl-tile]
strategy:
fail-fast: false
matrix:
runs-on: [
"ubuntu-22.04",
"ubuntu-22.04-arm",
"macos-14",
"windows-2022"
]
python-version: [
"3.10", "3.11", "3.12",
"3.13", "3.14", "3.14t"
]
include: [
{runs-on: "ubuntu-22.04", name: "ubuntu_x86_64", os: "ubuntu"},
{runs-on: "ubuntu-22.04-arm", name: "ubuntu_aarch64", os: "ubuntu"},
{runs-on: "windows-2022", name: "windows_amd64", os: "windows"},
{runs-on: "macos-14", name: "macos_arm64", os: "macos"},
]
exclude:
# <frozen importlib._bootstrap>:491: Warning: Numpy built with MINGW-W64 on Windows 64 bits is experimental, and only available for testing. You are advised not to use it for production.
- runs-on: windows-2022
python-version: "3.14"
- runs-on: windows-2022
python-version: "3.14t"
- runs-on: macos-14
python-version: "3.10"
- runs-on: macos-14
python-version: "3.11"
- runs-on: macos-14
python-version: "3.12"
- runs-on: macos-14
python-version: "3.13"
- runs-on: macos-14
python-version: "3.14"
runs-on: ${{ matrix.runs-on }}
name: "Test eudsl-tile ${{ matrix.name }} ${{ matrix.python-version }}"
defaults:
run:
shell: bash
steps:
- name: "Check out repository"
uses: actions/checkout@v4.2.2
with:
submodules: false
- name: "Get submodules"
run: git submodule update --init --depth=1
- name: "Install Python"
uses: actions/setup-python@v6.0.0
with:
python-version: "${{ matrix.python-version }}"
- uses: actions/download-artifact@v4
with:
name: eudsl_tile_${{ matrix.name }}_artifact
path: wheelhouse
- name: "Test eudsl-tile"
run: |
python -m pip install pytest mlir-native-tools -f https://llvm.github.io/eudsl
python -m pytest $PWD/projects/eudsl-tile/tests
release-eudsl-tile:
if: (github.event_name == 'push' && github.ref_name == 'main') || github.event_name == 'workflow_dispatch'
needs: [build-eudsl-tile]
runs-on: "ubuntu-22.04"
permissions:
id-token: write
contents: write
strategy:
fail-fast: false
matrix:
name: [
"ubuntu_x86_64",
"ubuntu_aarch64",
"ubuntu_wasm32",
"macos_arm64",
"windows_amd64"
]
name: "Release eudsl-tile ${{ matrix.name }}"
steps:
- uses: actions/download-artifact@v4
with:
name: eudsl_tile_${{ matrix.name }}_artifact
path: wheelhouse
- name: Release current commit
uses: ncipollo/release-action@v1.12.0
with:
artifacts: "wheelhouse/eudsl_tile*.whl"
token: "${{ secrets.GITHUB_TOKEN }}"
tag: eudsl-tile
name: eudsl-tile
removeArtifacts: false
allowUpdates: true
replacesArtifacts: true
makeLatest: true
omitBody: true
call-deploy-pip-page:
if: (github.event_name == 'push' && github.ref_name == 'main') || github.event_name == 'workflow_dispatch'
needs: [release-eudsl-tile]
permissions:
contents: read
id-token: write
pages: write
uses: ./.github/workflows/deploy_pip_page.yml
secrets: inherit # pass all secrets