Merge branch 'main' of github.com:fabiwoller/NApyPI #23
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 wheels and run Linux integration tests | ||
| on: | ||
| push: | ||
| tags: ["v*"] | ||
| pull_request: | ||
| jobs: | ||
| build: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: pypa/cibuildwheel@v2.16 | ||
| env: | ||
| CIBW_BUILD: "cp39-* cp310-* cp311-*" | ||
| CIBW_SKIP: "pp* *-win32 *-manylinux_i686 *-musllinux_*" | ||
| CIBW_TEST_SKIP: "*-manylinux*" | ||
| PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu | ||
| CIBW_BEFORE_BUILD_MACOS: "brew install libomp" | ||
| CIBW_ENVIRONMENT_MACOS: > | ||
| OpenMP_ROOT=$(brew --prefix libomp) | ||
| MACOSX_DEPLOYMENT_TARGET=11.0 | ||
| CIBW_REPAIR_WHEEL_COMMAND_MACOS: > | ||
| delocate-listdeps {wheel} && | ||
| delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel} | ||
| CIBW_TEST_COMMAND: > | ||
| python -c "import napypi; print(napypi.__version__)" | ||
| integration-tests-linux: | ||
| name: Linux integration tests (${{ matrix.python }}) | ||
| runs-on: ubuntu-latest | ||
| needs: build-wheels | ||
| strategy: | ||
| matrix: | ||
| python: | ||
| - "3.9" | ||
| - "3.10" | ||
| - "3.11" | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python }} | ||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y libgomp1 | ||
| - name: Install napypi + CPU-only torch | ||
| env: | ||
| PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu | ||
| pip install . | ||
| - name: Run integration tests | ||
| run: | | ||
| python - <<'EOF' | ||
| import napypi | ||
| print("napypi:", napypi.__version__) | ||
| EOF | ||