-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP workflow for building wheels with cibuildwheel
- Loading branch information
Showing
1 changed file
with
71 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Build Wheels | ||
|
||
on: | ||
push: | ||
branches: | ||
# temp | ||
- BuildWheels | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Build wheels for ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
# If true, Github will cancel all other jobs in the matrix if any of them fails | ||
fail-fast: false | ||
matrix: | ||
# macos-13 is x86_64, macos-14 is arm64. | ||
# cibuildwheel takes care of building for all supported Python versions as stated in pyproject.toml | ||
os: [ | ||
ubuntu-latest, | ||
windows-latest, | ||
macos-13, | ||
macos-14 | ||
] | ||
|
||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
# Fetch everything to ensure we get tags | ||
fetch-depth: 0 | ||
|
||
# Install Conan here already because we want to cache/restore its installed dependencies. | ||
# TODO: Caching requires more work on linux wheels since those happen inside Docker environment | ||
- name: Install Conan | ||
run: pip install conan==2.8.1 | ||
|
||
- name: Get Conan cache path | ||
id: conan-cache-path | ||
run: echo "conan_cache=$(conan config home)" >> $GITHUB_OUTPUT | ||
|
||
- name: Cache Conan dependencies | ||
id: cache-conan | ||
uses: actions/cache@v4 | ||
env: | ||
cache-name: conan2-cache | ||
with: | ||
path: ${{ steps.conan-cache-path.outputs.conan_cache }} | ||
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/conanfile.py') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ env.cache-name }}- | ||
# Create new Conan profile only if we didn't hit cache | ||
- if: ${{ steps.cache-conan.outputs.cache-hit != 'true' }} | ||
name: Create default Conan profile if no cache was hit | ||
run: conan profile detect --exist-ok | ||
|
||
- name: Build and test wheels (cibuildwheel) | ||
uses: pypa/cibuildwheel@v2.21.3 | ||
|
||
- name: Upload wheels | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | ||
path: ./wheelhouse/*.whl |