@@ -82,35 +82,97 @@ jobs:
82
82
include :
83
83
- os : ubuntu-latest
84
84
package-suffix : linux-amd64
85
+ ci-arch : auto
85
86
- os : macos-latest
86
87
package-suffix : macos-amd64
88
+ ci-arch : auto
89
+ - os : macos-latest
90
+ package-suffix : macos-arm64
91
+ ci-arch : arm64
92
+ rust-add-target : aarch64-apple-darwin
87
93
- os : windows-latest
88
94
package-suffix : windows-amd64
95
+ ci-arch : auto
89
96
runs-on : ${{ matrix.os }}
90
97
steps :
91
98
- uses : actions/checkout@v2
92
99
with :
93
100
submodules : recursive
94
- - uses : actions-rs/toolchain@v1
101
+ - uses : actions/setup-python@v1
102
+ with :
103
+ python-version : " 3.10"
104
+
105
+ # Install Rust locally for non-Linux (Linux uses an internal docker
106
+ # command to build with cibuildwheel which uses rustup install defined
107
+ # in pyproject.toml)
108
+ - if : ${{ runner.os != 'Linux' }}
109
+ uses : actions-rs/toolchain@v1
95
110
with :
96
111
toolchain : stable
97
- - uses : Swatinem/rust-cache@v1
112
+ target : ${{ matrix.rust-add-target }}
113
+ - if : ${{ runner.os != 'Linux' }}
114
+ uses : Swatinem/rust-cache@v1
98
115
with :
99
116
working-directory : temporalio/bridge
117
+
118
+ # Prepare
119
+ - run : python -m pip install --upgrade wheel poetry poethepoet
120
+ - run : poetry install --no-root
121
+
122
+ # Add the source dist only for Linux x64 for now
123
+ - if : ${{ matrix.package-suffix == 'linux-amd64' }}
124
+ run : poetry build --format sdist
125
+
126
+ # Build and fix the wheel
127
+ - run : poetry run cibuildwheel --output-dir dist --arch ${{ matrix.ci-arch }}
128
+ - run : poe fix-wheel
129
+
130
+ # Do test only for ci-arch auto (i.e. local machine)
131
+ - if : ${{ matrix.ci-arch == 'auto' }}
132
+ uses : actions/setup-go@v2
133
+ with :
134
+ go-version : " 1.18"
135
+ - if : ${{ matrix.ci-arch == 'auto' }}
136
+ run : poe test-dist-single
137
+
138
+ # Upload dist
139
+ - uses : actions/upload-artifact@v2
140
+ with :
141
+ name : packages-${{ matrix.package-suffix }}
142
+ path : dist
143
+
144
+ # We separate out Linux aarch64 so we can choose not to run it during PR since
145
+ # it is so slow in cibuildwheel (uses QEMU emulation). We can put this back in
146
+ # the above matrix when Linux ARM runners are available.
147
+ compile-binaries-linux-aarch64 :
148
+ # Skip compiling Linux aarch64 on PR
149
+ if : ${{ github.event_name != 'pull_request' }}
150
+ runs-on : ubuntu-latest
151
+ steps :
152
+ - uses : actions/checkout@v2
153
+ with :
154
+ submodules : recursive
100
155
- uses : actions/setup-python@v1
101
156
with :
102
157
python-version : " 3.10"
103
- # Needed for tests since they use external server
104
- - uses : actions/setup-go@v2
158
+
159
+ # Need QEMU for ARM build on Linux
160
+ - uses : docker/setup-qemu-action@v1
105
161
with :
106
- go-version : " 1.18"
162
+ image : tonistiigi/binfmt:latest
163
+ platforms : arm64
164
+
165
+ # Prepare
107
166
- run : python -m pip install --upgrade wheel poetry poethepoet
108
167
- run : poetry install --no-root
109
- - run : poetry build
168
+
169
+ # Build and fix the wheel
170
+ - run : poetry run cibuildwheel --output-dir dist --arch aarch64
110
171
- run : poe fix-wheel
111
- - run : poe test-dist-single
172
+
173
+ # Upload dist
112
174
- uses : actions/upload-artifact@v2
113
175
with :
114
- name : packages-${{ matrix.package-suffix }}
176
+ name : packages-linux-aarch64
115
177
path : dist
116
178
0 commit comments