-
Notifications
You must be signed in to change notification settings - Fork 307
211 lines (189 loc) · 6.3 KB
/
pycdePublish.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
name: PyCDE Test and Publish
# Build the wheels for a series of Python versions and OSes and publish them to
# PyPI.
on:
push:
tags:
- pycde-*
workflow_dispatch:
jobs:
# Build CIRCT and run its tests using a Docker container with all the
# integration testing prerequisite installed.
build-linux:
name: Build
# Run on an internal MSFT subscription. Please DO NOT use this for any other
# workflows without talking to John Demme (john.demme@microsoft.com, GH
# teqdruid) first. We may lose funding for this if it ends up costing too
# much.
# If individual jobs fail due to timeouts or disconnects, please report to
# John and re-run the job.
# runs-on:
# - self-hosted
# - 1ES.Pool=1ES-CIRCT-builds
# - 1ES.ImageOverride=CIRCT-StdUbuntu2204
runs-on: ubuntu-latest
strategy:
# Keep the 'matrix' strategy with one data point to make it obvious that
# this is one point in the overall matrix.
matrix:
python-env:
- cp38-manylinux_x86_64
- cp39-manylinux_x86_64
- cp310-manylinux_x86_64
- cp311-manylinux_x86_64
- cp312-manylinux_x86_64
env:
SCCACHE_GHA_ENABLED: "true"
SCCACHE_CACHE_SIZE: 15GB
steps:
- name: Set up sccache
uses: mozilla-actions/sccache-action@v0.0.4
# Clone the CIRCT repo and its submodules. Do shallow clone to save clone
# time.
- name: Get CIRCT
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
submodules: false
- name: Get shallow LLVM submodule
run: |
git submodule update --init --recursive --recommend-shallow --depth 1
# --------
# Build and test CIRCT
# --------
- name: Install dependencies
run: |
set -o errexit
python3 -m pip install --upgrade pip
python3 -m pip install cibuildwheel twine
- name: Build wheel
env:
CIBW_BUILD: ${{ matrix.python-env }}
CMAKE_GENERATOR: Ninja
SETUPTOOLS_SCM_DEBUG: True
BUILD_TYPE: Release
RUN_TESTS: True
COMPILER_LAUNCHER: sccache
run: |
set -o errexit
export PATH=$PATH:$HOME/.local/bin
echo "Building wheel"
cibuildwheel --output-dir wheelhouse frontends/PyCDE
- name: Get wheel name
shell: bash
id: whl-name
run: |
cd wheelhouse
echo WHL=`ls *.whl` >> "$GITHUB_OUTPUT"
- name: Upload wheels as artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.whl-name.outputs.WHL }}
path: wheelhouse/${{ steps.whl-name.outputs.WHL }}
retention-days: 7
if-no-files-found: error
# Build PyCDE, test it, and publish it to PyPI.
build-windows:
name: Build
# Run on an internal MSFT subscription. Please DO NOT use this for any other
# workflows without talking to John Demme (john.demme@microsoft.com, GH
# teqdruid) first. We may lose funding for this if it ends up costing too
# much.
# If individual jobs fail due to timeouts or disconnects, please report to
# John and re-run the job.
# runs-on:
# - self-hosted
# - 1ES.Pool=1ES-CIRCT-builds
# - 1ES.ImageOverride=1esMMSWindows2022
runs-on: windows-latest
strategy:
# Keep the 'matrix' strategy with one data point to make it obvious that
# this is one point in the overall matrix.
matrix:
python-env:
- cp38-win_amd64
- cp39-win_amd64
- cp310-win_amd64
- cp311-win_amd64
- cp312-win_amd64
env:
SCCACHE_GHA_ENABLED: "true"
steps:
- name: Set up sccache
uses: mozilla-actions/sccache-action@v0.0.4
- name: Build additional c++ deps
shell: pwsh
run: |
& "${env:VCPKG_INSTALLATION_ROOT}/vcpkg" --triplet x64-windows install zlib capnproto
# Clone the CIRCT repo and its submodules. Do shallow clone to save clone
# time.
- name: Get CIRCT
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
submodules: false
- name: Get shallow LLVM submodule
run: |
git submodule update --init --recursive --recommend-shallow --depth 1
# --------
# Build and test CIRCT
# --------
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install cibuildwheel twine
choco install ninja sccache
- name: Build wheel
shell: cmd
env:
CIBW_BUILD: ${{ matrix.python-env }}
CMAKE_GENERATOR: Ninja
SETUPTOOLS_SCM_DEBUG: True
BUILD_TYPE: Release
# PyCDE integration tests are not yet implemented on Windows.
RUN_TESTS: False
COMPILER_LAUNCHER: sccache
run: |
echo "Building wheel"
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64 -host_arch=x64 && python3 -m cibuildwheel --output-dir wheelhouse frontends/PyCDE
- name: Get wheel name
shell: bash
id: whl-name
run: |
cd wheelhouse
echo WHL=`ls *.whl` >> "$GITHUB_OUTPUT"
- name: Upload wheels as artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.whl-name.outputs.WHL }}
path: wheelhouse/${{ steps.whl-name.outputs.WHL }}
retention-days: 7
if-no-files-found: error
push_wheels:
name: Push wheels (Tag or Weekly)
runs-on: ubuntu-20.04
if: github.repository == 'llvm/circt'
# && (github.ref_type == 'tag' || github.event_name == 'schedule')
needs:
- build-linux
- build-windows
environment:
name: pypi
url: https://pypi.org/p/esiaccel
permissions:
id-token: write
steps:
- name: Download wheels
uses: actions/download-artifact@v4
with:
path: ./wheelhouse/
- name: List downloaded wheels
run: ls -laR
working-directory: ./wheelhouse/
- name: Upload wheels to pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: wheelhouse/
verify-metadata: false