Antoine fixes #47
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
name: Check PR | |
on: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build_wheels: | |
name: Build wheels (${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-13, macos-14] | |
env: | |
MACOSX_DEPLOYMENT_TARGET: 13.0 | |
steps: | |
- name: Set MACOSX_DEPLOYMENT_TARGET | |
run: | | |
if [[ ${{ matrix.os }} = macos-13 ]] | |
then | |
echo "MACOSX_DEPLOYMENT_TARGET=13.0" >> "$GITHUB_ENV" | |
elif [[ ${{ matrix.os }} = macos-14 ]] | |
then | |
echo "MACOSX_DEPLOYMENT_TARGET=14.0" >> "$GITHUB_ENV" | |
fi | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Build wheels | |
uses: pypa/[email protected] | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }} | |
path: wheelhouse/*.whl | |
run_tests: | |
name: Run tests locally (${{ matrix.os }}, ${{ matrix.python-version }}) | |
runs-on: ${{ matrix.os }} | |
needs: build_wheels | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-13, macos-14] | |
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: cibw-* | |
path: dist | |
merge-multiple: true | |
- name: Upgrade pip | |
run: pip install --upgrade pip | |
- name: Install wheel | |
run: pip install wheel | |
- name: Install locally | |
run: | | |
if [[ ${{ matrix.os }} = ubuntu-latest ]] | |
then | |
pip install "$(echo dist/swisspair*cp"$(tr -d . <<< "${{ matrix.python-version }}")"*manylinux*x86_64*.whl)"[test] | |
elif [[ ${{ matrix.os }} = macos-13 ]] | |
then | |
for i in dist/swisspair*.whl | |
do | |
pip install "$i" || true | |
done | |
exit 1 | |
elif [[ ${{ matrix.os }} = macos-14 ]] | |
then | |
pip install "$(echo dist/swisspair*cp"$(tr -d . <<< "${{ matrix.python-version }}")"*macosx_14_0*arm64.whl)"[test] | |
fi | |
- name: Run tests | |
run: pytest |