|
| 1 | +name: Pip |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - master |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 12 | + cancel-in-progress: true |
| 13 | + |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + matrix: |
| 19 | + platform: [windows-latest, macos-13, ubuntu-latest] |
| 20 | + python-version: ["3.7", "3.11"] |
| 21 | + |
| 22 | + runs-on: ${{ matrix.platform }} |
| 23 | + |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + |
| 27 | + - uses: actions/setup-python@v5 |
| 28 | + with: |
| 29 | + python-version: ${{ matrix.python-version }} |
| 30 | + |
| 31 | + - name: Add requirements |
| 32 | + run: python -m pip install --upgrade wheel setuptools |
| 33 | + |
| 34 | + - name: Build and install |
| 35 | + run: pip install --verbose . |
| 36 | + |
| 37 | + - name: Test |
| 38 | + run: python tests/test.py |
| 39 | + |
| 40 | + build-mingw64: |
| 41 | + runs-on: windows-latest |
| 42 | + defaults: |
| 43 | + run: |
| 44 | + shell: msys2 {0} |
| 45 | + steps: |
| 46 | + - uses: msys2/setup-msys2@v2 |
| 47 | + with: |
| 48 | + update: true |
| 49 | + install: >- |
| 50 | + mingw-w64-x86_64-gcc |
| 51 | + mingw-w64-x86_64-python-pip |
| 52 | + mingw-w64-x86_64-python-wheel |
| 53 | +
|
| 54 | + - uses: actions/checkout@v4 |
| 55 | + |
| 56 | + - name: Install pybind11 |
| 57 | + # This is required because --no-build-isolation disable dependences |
| 58 | + # installation |
| 59 | + run: pip install pybind11 |
| 60 | + |
| 61 | + - name: Build and install |
| 62 | + # --no-build-isolation is required because the vanilla setuptool does not |
| 63 | + # support Mingw64.See patches here: |
| 64 | + # https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-python-setuptools |
| 65 | + # Without those patches build_ext fails with: |
| 66 | + # error: --plat-name must be one of ('win32', 'win-amd64', 'win-arm32', 'win-arm64') |
| 67 | + run: pip install --no-build-isolation . |
| 68 | + |
| 69 | + - name: Test |
| 70 | + run: python tests/test.py |
0 commit comments