|
| 1 | +name: Build Status |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + tags: |
| 8 | + - v* |
| 9 | + paths-ignore: |
| 10 | + - LICENSE |
| 11 | + - README.md |
| 12 | + pull_request: |
| 13 | + branches: |
| 14 | + - main |
| 15 | + workflow_dispatch: |
| 16 | + |
| 17 | +concurrency: |
| 18 | + group: {% raw %}${{ github.workflow }}-${{ github.head_ref || github.run_id }}{% endraw %} |
| 19 | + cancel-in-progress: true |
| 20 | + |
| 21 | +permissions: |
| 22 | + contents: read |
| 23 | + checks: write |
| 24 | + pull-requests: write |
| 25 | + |
| 26 | +jobs: |
| 27 | + build: |
| 28 | + runs-on: {% raw %}${{ matrix.os }}{% endraw %} |
| 29 | + |
| 30 | + strategy: |
| 31 | + matrix: |
| 32 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 33 | + python-version: ["3.9", "3.10", "3.11", "3.12"] |
| 34 | + cibuildwheel: ["cp39", "cp310", "cp311", "cp312"] |
| 35 | + exclude: |
| 36 | + - python-version: "3.9" |
| 37 | + cibuildwheel: "cp310" |
| 38 | + - python-version: "3.9" |
| 39 | + cibuildwheel: "cp311" |
| 40 | + - python-version: "3.9" |
| 41 | + cibuildwheel: "cp312" |
| 42 | + - python-version: "3.10" |
| 43 | + cibuildwheel: "cp39" |
| 44 | + - python-version: "3.10" |
| 45 | + cibuildwheel: "cp311" |
| 46 | + - python-version: "3.10" |
| 47 | + cibuildwheel: "cp312" |
| 48 | + - python-version: "3.11" |
| 49 | + cibuildwheel: "cp39" |
| 50 | + - python-version: "3.11" |
| 51 | + cibuildwheel: "cp310" |
| 52 | + - python-version: "3.11" |
| 53 | + cibuildwheel: "cp312" |
| 54 | + - python-version: "3.12" |
| 55 | + cibuildwheel: "cp39" |
| 56 | + - python-version: "3.12" |
| 57 | + cibuildwheel: "cp310" |
| 58 | + - python-version: "3.12" |
| 59 | + cibuildwheel: "cp311" |
| 60 | + |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@v4 |
| 63 | + |
| 64 | + - name: Set up Python {% raw %}${{ matrix.python-version }}{% endraw %} |
| 65 | + uses: actions/setup-python@v5 |
| 66 | + with: |
| 67 | + python-version: {% raw %}${{ matrix.python-version }}{% endraw %} |
| 68 | + cache: 'pip' |
| 69 | + cache-dependency-path: 'pyproject.toml' |
| 70 | + |
| 71 | + - name: Install dependencies |
| 72 | + run: make develop |
| 73 | + if: matrix.os != 'windows-latest' |
| 74 | + |
| 75 | + - name: Install dependencies |
| 76 | + run: | |
| 77 | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" |
| 78 | + make develop |
| 79 | + shell: cmd |
| 80 | + if: matrix.os == 'windows-latest' |
| 81 | + |
| 82 | + - name: Lint |
| 83 | + run: make lint |
| 84 | + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' |
| 85 | + |
| 86 | + - name: Checks |
| 87 | + run: make checks |
| 88 | + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' |
| 89 | + |
| 90 | + - name: Install build dependencies |
| 91 | + run: pip install cibuildwheel |
| 92 | + |
| 93 | + - name: Build (Linux) |
| 94 | + run: make build-cibw |
| 95 | + env: |
| 96 | + CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-manylinux*"{% endraw %} |
| 97 | + CIBW_BUILD_VERBOSITY: 3 |
| 98 | + if: matrix.os == 'ubuntu-latest' |
| 99 | + |
| 100 | + - name: Build (Macos) |
| 101 | + run: make build-cibw |
| 102 | + env: |
| 103 | + CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-macos*"{% endraw %} |
| 104 | + CIBW_BUILD_VERBOSITY: 3 |
| 105 | + if: matrix.os == 'macos-latest' |
| 106 | + |
| 107 | + - name: Build (Windows) |
| 108 | + run: make build-cibw |
| 109 | + env: |
| 110 | + CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-win_amd64"{% endraw %} |
| 111 | + CIBW_BEFORE_ALL: call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" |
| 112 | + if: matrix.os == 'windows-latest' |
| 113 | + |
| 114 | + - name: Test |
| 115 | + run: make coverage |
| 116 | + |
| 117 | + - name: Upload test results (Python) |
| 118 | + uses: actions/upload-artifact@v4 |
| 119 | + with: |
| 120 | + name: {% raw %}test-results-${{ matrix.os }}-${{ matrix.python-version }}{% endraw %} |
| 121 | + path: junit.xml |
| 122 | + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' |
| 123 | + |
| 124 | + - name: Publish Unit Test Results |
| 125 | + uses: EnricoMi/publish-unit-test-result-action@v2 |
| 126 | + with: |
| 127 | + files: '**/junit.xml' |
| 128 | + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' |
| 129 | + |
| 130 | + - name: Upload coverage |
| 131 | + uses: codecov/codecov-action@v5 |
| 132 | + with: |
| 133 | + token: {% raw %}${{ secrets.CODECOV_TOKEN }}{% endraw %} |
| 134 | + |
| 135 | + - uses: actions/upload-artifact@v4 |
| 136 | + with: |
| 137 | + name: {% raw %}dist-${{matrix.os}}-${{matrix.python-version}}{% endraw %} |
| 138 | + path: dist |
0 commit comments