Tests #2604
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: Tests | |
| on: | |
| push: | |
| branches-ignore: | |
| - "claude/**" | |
| pull_request: | |
| schedule: | |
| - cron: "0 8 * * *" | |
| concurrency: | |
| group: >- | |
| ${{ github.workflow }}- | |
| ${{ github.ref_type }}- | |
| ${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash -eux {0} | |
| jobs: | |
| tests: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python-version: ["3.10", "3.13", "3.14"] | |
| include: | |
| - os: ubuntu-latest | |
| python-version: "3.11" | |
| - os: ubuntu-latest | |
| python-version: "3.12" | |
| # Free-threaded builds aren't in the runner tool cache and are | |
| # expensive to provision on Windows/macOS (~73s vs ~23s on Linux), | |
| # so exercise 3.14t on Linux only. | |
| - os: ubuntu-latest | |
| python-version: "3.14t" | |
| - os: ubuntu-latest | |
| python-version: "pypy-3.11" | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
| with: | |
| node_version: "none" | |
| python_package_manager: "uv pip" | |
| - name: Run Tests | |
| run: hatch run cov:test | |
| # Codecov merges the uploads of every matrix job into one report for | |
| # the commit, so each job uploads its own and nothing combines them here. | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: coverage.xml | |
| disable_search: true | |
| flags: ${{ matrix.os }}-${{ matrix.python-version }} | |
| # Empty on pull requests from forks, where Codecov falls back to a | |
| # tokenless upload. Flip fail_ci_if_error on once the secret is set. | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| test_minimum_versions: | |
| name: Test Minimum Versions | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Base Setup | |
| uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
| with: | |
| dependency_type: minimum | |
| node_version: "none" | |
| python_package_manager: "uv pip" | |
| - name: Run the unit tests | |
| run: hatch run test:nowarn | |
| test_lint: | |
| name: Test Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
| with: | |
| node_version: "none" | |
| python_package_manager: "uv pip" | |
| - name: Run Linters | |
| run: | | |
| hatch run typing:test | |
| hatch run lint:build | |
| pipx run 'validate-pyproject[all]' pyproject.toml | |
| pipx run doc8 --max-line-length=200 | |
| test_docs: | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
| with: | |
| node_version: "none" | |
| python_package_manager: "uv pip" | |
| - name: Build the docs | |
| run: hatch run docs:build | |
| test_prereleases: | |
| name: Test Prereleases | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Base Setup | |
| uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
| with: | |
| dependency_type: pre | |
| node_version: "none" | |
| python_package_manager: "uv pip" | |
| - name: Run the tests | |
| run: hatch run test:nowarn | |
| make_sdist: | |
| name: Make SDist | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
| with: | |
| node_version: "none" | |
| python_package_manager: "uv pip" | |
| - uses: jupyterlab/maintainer-tools/.github/actions/make-sdist@v1 | |
| test_sdist: | |
| runs-on: ubuntu-latest | |
| needs: [make_sdist] | |
| name: Install from SDist and Test | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
| with: | |
| node_version: "none" | |
| python_package_manager: "uv pip" | |
| - uses: jupyterlab/maintainer-tools/.github/actions/test-sdist@v1 | |
| # Downstream projects are slow and only meaningful if traitlets itself is | |
| # healthy, so hold them until every fast job has finished and passed. | |
| downstream: | |
| needs: | |
| - tests | |
| - test_minimum_versions | |
| - test_lint | |
| - test_docs | |
| - test_prereleases | |
| - test_sdist | |
| uses: ./.github/workflows/downstream.yml | |
| check_links: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
| with: | |
| node_version: "none" | |
| python_package_manager: "uv pip" | |
| - uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1 | |
| check_release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Base Setup | |
| uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
| with: | |
| node_version: "none" | |
| python_package_manager: "uv pip" | |
| - name: Install Dependencies | |
| run: | | |
| pip install -e . | |
| - name: Check Release | |
| uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} |