|
| 1 | +name: Test notebooks |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + schedule: |
| 11 | + - cron: '0 5 * * 1' |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +concurrency: |
| 15 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 16 | + cancel-in-progress: true |
| 17 | + |
| 18 | +jobs: |
| 19 | + tests: |
| 20 | + # Do not run the test matrix on PRs affecting the rendering |
| 21 | + if: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'html rendering / skip testing') }} |
| 22 | + |
| 23 | + name: ${{ matrix.os }} ${{ matrix.name }} |
| 24 | + runs-on: ${{ matrix.os }} |
| 25 | + strategy: |
| 26 | + fail-fast: false |
| 27 | + matrix: |
| 28 | + # Run all supported OS for one Python version, then add a few extra scenarios |
| 29 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 30 | + python-version: ['3.12'] |
| 31 | + toxenv: [py312-test] |
| 32 | + name: ['with Python 3.12',] |
| 33 | + |
| 34 | + include: |
| 35 | + - python-version: '3.10' |
| 36 | + toxenv: py310-test-oldestdeps |
| 37 | + name: with Python 3.10 and oldest versioned dependencies |
| 38 | + os: ubuntu-latest |
| 39 | + |
| 40 | + - python-version: '3.13' |
| 41 | + toxenv: py313-test-devdeps |
| 42 | + name: with Python 3.13 and developer versioned dependencies |
| 43 | + os: ubuntu-latest |
| 44 | + |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
| 47 | + - name: Set up Python ${{ matrix.python-version }} |
| 48 | + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d #v5.1.0 |
| 49 | + with: |
| 50 | + python-version: ${{ matrix.python-version }} |
| 51 | + |
| 52 | + - name: Install dependencies |
| 53 | + run: python -m pip install --upgrade tox |
| 54 | + |
| 55 | + - name: Test with tox |
| 56 | + run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }} |
| 57 | + |
| 58 | + |
| 59 | + gha_buildhtml: |
| 60 | + # When label is used, we do run buildhtml on GHA to check if the publishing job will run or not. |
| 61 | + # Use in case when new content has run into troubles on CircleCI. |
| 62 | + if: ${{ (github.event_name == 'pull_request') && contains(github.event.pull_request.labels.*.name, 'GHA buildhtml') }} |
| 63 | + name: Buildhtml testing |
| 64 | + runs-on: ubuntu-latest |
| 65 | + steps: |
| 66 | + - uses: actions/checkout@v4 |
| 67 | + |
| 68 | + - name: Setup Python |
| 69 | + uses: actions/setup-python@v5 |
| 70 | + with: |
| 71 | + python-version: '3.11' |
| 72 | + |
| 73 | + - name: Install dependencies |
| 74 | + run: python -m pip install --upgrade tox |
| 75 | + |
| 76 | + - name: Execute notebooks as testing |
| 77 | + run: tox -e py311-buildhtml |
0 commit comments