Skip to content

Commit

Permalink
Merge pull request #1511 from brian-team/cache_cibuildwheel
Browse files Browse the repository at this point in the history
Cache cibuildwheel and other minor GitHub Action changes
  • Loading branch information
mstimberg committed Mar 13, 2024
2 parents eaeb90f + 9a1e26e commit 3cc9f99
Showing 1 changed file with 39 additions and 7 deletions.
46 changes: 39 additions & 7 deletions .github/workflows/publish.yml
Expand Up @@ -31,17 +31,33 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.5
- name: Install platformdirs
run: python -m pip install platformdirs
- name: Display cibuildwheel cache dir
id: cibuildwheel-cache
run: |
from platformdirs import user_cache_path
import os
with open(os.getenv('GITHUB_OUTPUT'), 'w') as f:
f.write(f"dir={str(user_cache_path(appname='cibuildwheel', appauthor='pypa'))}")
shell: python
- name: Cache cibuildwheel tools
uses: actions/cache@v4
with:
path: ${{ steps.cibuildwheel-cache.outputs.dir }}
key: ${{ runner.os }}-cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir dist
uses: pypa/cibuildwheel@v2.17.0
env:
CIBW_PROJECT_REQUIRES_PYTHON: ">=${{ needs.get_python_versions.outputs.min-python }}"
CIBW_ARCHS: auto64
# Do not build for PyPy
CIBW_SKIP: 'pp*'
CIBW_TEST_COMMAND: python {project}/dev/continuous-integration/run_simple_test.py
CIBW_TEST_REQUIRES: pytest
with:
output-dir: dist
- name: store distribution 📦
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -71,20 +87,36 @@ jobs:
python -m build --sdist --config-setting=--formats=gztar --config-setting=--with-cython --config-setting=--fail-on-error
if: ${{ matrix.arch == 'auto64' }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.5
- name: Install platformdirs
run: python -m pip install platformdirs
- name: Display cibuildwheel cache dir
id: cibuildwheel-cache
run: |
from platformdirs import user_cache_path
import os
with open(os.getenv('GITHUB_OUTPUT'), 'w') as f:
f.write(f"dir={str(user_cache_path(appname='cibuildwheel', appauthor='pypa'))}")
shell: python
- name: Cache cibuildwheel tools
uses: actions/cache@v4
with:
path: ${{ steps.cibuildwheel-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.arch }}-cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir dist
uses: pypa/cibuildwheel@v2.17.0
env:
CIBW_PROJECT_REQUIRES_PYTHON: ">=${{ needs.get_python_versions.outputs.min-python }}"
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_SKIP: 'pp* *-musllinux_aarch64'
CIBW_TEST_COMMAND: python {project}/dev/continuous-integration/run_simple_test.py
CIBW_TEST_REQUIRES: pytest
with:
output-dir: dist
- name: store distribution 📦
uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit 3cc9f99

Please sign in to comment.