Skip to content

Commit

Permalink
Updating CI actions
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescAlted committed Sep 27, 2023
1 parent d10283b commit c504921
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 50 deletions.
74 changes: 28 additions & 46 deletions .github/workflows/cibuildwheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,39 @@ on:
branches:
- main

env:
CIBW_BEFORE_BUILD: pip install -r requirements-build.txt
CIBW_BUILD_VERBOSITY: 1
CIBW_TEST_REQUIRES: pytest numpy<2 psutil msgpack
CIBW_TEST_COMMAND: python -m pytest -m "not heavy" {project}/tests
CIBW_TEST_SKIP: "*macosx*arm64*"
# Building for musllinux and aarch64 takes way too much time.
# NumPy is adding musllinux for just x86_64 too, so this is not too bad.
CIBW_SKIP: "*musllinux*aarch64*"

jobs:

build_wheels:
name: Build wheels on ${{ matrix.os }} (${{ matrix.arch }})
runs-on: ${{ matrix.os }}
# Only build wheels when tagging (typically a release)
if: startsWith(github.event.ref, 'refs/tags')
name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }} - ${{ matrix.p_ver }}
runs-on: ${{ matrix.os }}
permissions:
contents: write
env:
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_ARCHS_MACOS: "x86_64 arm64"
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
arch: [x86_64, aarch64]
cibw_build: ["cp3{9,10,11,12}-*"]
p_ver: ["3.9-3.12"]
exclude:
- os: windows-latest
arch: aarch64
# cibuild is already in charge to build aarch64 (see CIBW_ARCHS_MACOS)
- os: macos-latest
arch: aarch64

Expand All @@ -35,15 +53,14 @@ jobs:
with:
submodules: 'recursive'

# - uses: conda-incubator/setup-miniconda@v2
# with:
# auto-update-conda: true
# python-version: ${{ matrix.python-version }}

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.9'

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel
- name: Set up QEMU
if: ${{ matrix.arch == 'aarch64' }}
Expand All @@ -52,44 +69,9 @@ jobs:
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master

- name: Install MSVC amd64
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-build.txt
python -m pip install -r requirements-test-wheels.txt
python -m pip install -r requirements-runtime.txt
- name: Build wheels (Windows)
if: runner.os == 'Windows'
run: |
python -m pip install --upgrade pip
python -m pip install cibuildwheel
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: 'cp38-win_amd64 cp39-win_amd64 cp310-win_amd64 cp311-win_amd64'
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: python -m pytest -m "not heavy" {project}/tests
CIBW_BUILD_VERBOSITY: 1

- name: Build wheels (Linux / Mac OSX)
if: runner.os != 'Windows'
- name: Build wheels
run: |
python -m pip install --upgrade pip
python -m pip install cibuildwheel
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: 'cp38-* cp39-* cp310-* cp311-*'
CIBW_SKIP: '*-manylinux*_i686 *-musllinux_* ${{ env.CIBW_SKIP}}'
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: python -m pytest -m "not heavy" {project}/tests
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS_MACOS: "x86_64 arm64"
- name: Upload wheels
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -123,8 +105,6 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-build.txt
python -m pip install -r requirements-tests.txt
python -m pip install -r requirements-runtime.txt
- name: Build sdist
run: |
Expand All @@ -145,6 +125,8 @@ jobs:
- name: Test sdist package with pytest
run: |
cd ./dist/blosc2-*/
python -m pip install -r requirements-tests.txt
python -m pip install -r requirements-runtime.txt
python -m pytest -m "not heavy"
upload_pypi:
Expand Down
7 changes: 4 additions & 3 deletions requirements-build.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
setuptools
scikit-build
cython<3
cython
cmake
numpy<2
build
oldest-supported-numpy
ninja
1 change: 0 additions & 1 deletion requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pip
numpy<2
pytest
psutil
Expand Down

0 comments on commit c504921

Please sign in to comment.