Repository navigation
ci: cache Conan packages across wheel builds #85
This file contains hidden or 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
| name: Build | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # macos-13 is an intel runner, macos-14 is apple silicon | |
| os: [ ubuntu-latest, windows-latest, macos-14 ] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Cache Conan packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.conan2 | |
| key: conan-${{ matrix.os }}-${{ hashFiles('conanfile.txt') }} | |
| restore-keys: | | |
| conan-${{ matrix.os }}- | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v3.4.1 | |
| env: | |
| CIBW_SKIP: "*-win32 *-manylinux_i686" # Skip 32-bit builds | |
| # Linux wheels build inside a container — mount the host Conan cache in | |
| CIBW_CONTAINER_ENGINE: "docker; create_args: --volume /home/runner/.conan2:/root/.conan2" | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
| path: ./wheelhouse/*.whl |