-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: build linux-arm64 wheels using emulation (#1102)
Stop using self-hosted runner
- Loading branch information
Showing
2 changed files
with
15 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,29 +4,13 @@ on: | |
|
||
jobs: | ||
# Build python wheels | ||
build_matrix: | ||
name: Prepare job matrix for build job | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: set-matrix | ||
# match github.ref to the on_ref_regex field in the json | ||
# to skip running linux/aarch64 builds on PRs | ||
run: | | ||
matrix=$(jq --arg ref "${{ github.ref }}" \ | ||
'map(select(.on_ref_regex as $pat | $pat == null or ($ref | test($pat))) | del(.on_ref_regex))' \ | ||
.github/build-matrix.json) | ||
echo matrix={\"include\":$(echo $matrix)}\" >> $GITHUB_OUTPUT | ||
build: | ||
name: Build wheels on ${{ join(matrix.os, '/') }}/${{ matrix.vers }} | ||
needs: build_matrix | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{fromJson(needs.build_matrix.outputs.matrix)}} | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
env: | ||
SCCACHE_VERSION: 0.2.13 | ||
CIBW_BEFORE_ALL_LINUX: "curl https://sh.rustup.rs -sSf | env -u CARGO_HOME sh -s -- --default-toolchain stable --profile minimal -y" | ||
|
@@ -36,25 +20,30 @@ jobs: | |
CIBW_BEFORE_ALL_WINDOWS: "rustup target add x86_64-pc-windows-msvc i686-pc-windows-msvc" | ||
CIBW_ENVIRONMENT: 'PATH="$PATH:$HOME/.cargo/bin" LIBCST_NO_LOCAL_SCHEME=$LIBCST_NO_LOCAL_SCHEME' | ||
CIBW_SKIP: "cp27-* cp34-* cp35-* pp* *-win32 *-win_arm64 *-musllinux_*" | ||
CIBW_ARCHS: ${{ matrix.vers }} | ||
CIBW_ARCHS_LINUX: auto aarch64 | ||
CIBW_ARCHS_MACOS: x86_64 arm64 | ||
CIBW_BUILD_VERBOSITY: 1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v5 | ||
if: ${{ !contains(matrix.os, 'self-hosted') }} | ||
with: | ||
cache: pip | ||
cache-dependency-path: "pyproject.toml" | ||
python-version: "3.10" | ||
python-version: "3.12" | ||
- name: Disable scmtools local scheme | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
run: >- | ||
echo LIBCST_NO_LOCAL_SCHEME=1 >> $GITHUB_ENV | ||
- name: Set up QEMU | ||
if: runner.os == 'Linux' | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: all | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: wheelhouse/*.whl | ||
name: wheels-${{matrix.os}}-${{matrix.vers}} | ||
name: wheels-${{matrix.os}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters