|
| 1 | +name: Build CI sdist and wheel |
| 2 | + |
| 3 | +on: |
| 4 | + # Save CI by only running this on release branches or tags. |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + - v[0-9]+.[0-9]+.x |
| 9 | + tags: |
| 10 | + - v* |
| 11 | + # Also allow running this action on PRs if requested by applying the |
| 12 | + # "Run cibuildwheel" label. |
| 13 | + pull_request: |
| 14 | + types: |
| 15 | + - opened |
| 16 | + - synchronize |
| 17 | + - reopened |
| 18 | + - labeled |
| 19 | + |
| 20 | +jobs: |
| 21 | + build_sdist: |
| 22 | + if: | |
| 23 | + github.event_name == 'push' || |
| 24 | + github.event_name == 'pull_request' && ( |
| 25 | + ( |
| 26 | + github.event.action == 'labeled' && |
| 27 | + github.event.label.name == 'Run cibuildwheel' |
| 28 | + ) || |
| 29 | + contains(github.event.pull_request.labels.*.name, 'Run cibuildwheel') |
| 30 | + ) |
| 31 | + name: Build sdist and wheel on ${{ matrix.os }} |
| 32 | + runs-on: ${{ matrix.os }} |
| 33 | + strategy: |
| 34 | + matrix: |
| 35 | + os: [ubuntu-20.04] |
| 36 | + python-version: ['3.8', '3.9', '3.10', '3.11.0-alpha - 3.11'] |
| 37 | + |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v3 |
| 40 | + with: |
| 41 | + fetch-depth: 0 |
| 42 | + |
| 43 | + - uses: actions/setup-python@v4 |
| 44 | + name: Install Python |
| 45 | + with: |
| 46 | + python-version: ${{ matrix.python-version }} |
| 47 | + |
| 48 | + - name: Install build |
| 49 | + run: pip install build |
| 50 | + |
| 51 | + - name: Build sdist and wheel |
| 52 | + run: python -m build . |
| 53 | + |
| 54 | + - name: Install built matplotlib sdist |
| 55 | + run: pip install dist/matplotlib*.tar.gz |
| 56 | + |
| 57 | + - name: Check version number is not 0 |
| 58 | + run: python ./ci/check_version_number.py |
| 59 | + |
| 60 | + - name: Install built matplotlib wheel |
| 61 | + run: pip install dist/matplotlib*.whl --force-reinstall |
| 62 | + |
| 63 | + - name: Check version number is not 0 |
| 64 | + run: python ./ci/check_version_number.py |
0 commit comments