Tests #576
This file contains 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: [main] | |
pull_request: | |
schedule: | |
# Run weekly | |
# * is a special character in YAML so you have to quote this string | |
- cron: "0 0 * * 0" | |
defaults: | |
run: | |
shell: bash -eux {0} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ["3.8", "3.12"] | |
include: | |
- os: windows-latest | |
python-version: "3.9" | |
- os: ubuntu-latest | |
python-version: "pypy-3.9" | |
- os: macos-latest | |
python-version: "3.10" | |
- os: ubuntu-latest | |
python-version: "3.11" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
- name: Run tests | |
run: hatch run cov:test | |
- name: Run cli checks | |
run: | | |
pip install -e . | |
hatch-jupyter-builder -h | |
hatch-jupyter-builder migrate -h | |
hatch-jupyter-builder compare-migrated -h | |
- uses: jupyterlab/maintainer-tools/.github/actions/upload-coverage@v1 | |
coverage: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jupyterlab/maintainer-tools/.github/actions/report-coverage@v1 | |
check_release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
- uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
check_links: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1 | |
with: | |
ignore_glob: "tests/data/**/README.md" | |
migration: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
- name: Run Migration Tests | |
run: hatch run migration:test | |
test_docs: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
- name: Build API docs | |
run: | | |
hatch run docs:api | |
# If this fails run `hatch run docs:api` locally | |
# and commit. | |
git status --porcelain | |
git status -s | grep "A" && exit 1 | |
git status -s | grep "M" && exit 1 | |
echo "API docs done" | |
- run: hatch run docs:build | |
test_lint: | |
name: Test Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
- name: Run Linters | |
run: | | |
hatch run typing:test | |
hatch run lint:build | |
pipx run interrogate -v . | |
pipx run doc8 --max-line-length=200 --ignore-path=docs/source/other/full-config.rst | |
test_minimum_versions: | |
name: Test Minimum Versions | |
timeout-minutes: 20 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
with: | |
dependency_type: minimum | |
- name: Run the unit tests | |
run: | | |
hatch run test:test | |
test_prereleases: | |
name: Test Prereleases | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
with: | |
dependency_type: pre | |
- name: Run the tests | |
run: hatch run test:test | |
make_sdist: | |
name: Make SDist | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
- 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 | |
- uses: jupyterlab/maintainer-tools/.github/actions/test-sdist@v1 | |
with: | |
test_command: hatch run test:test | |
tests_check: # This job does nothing and is only used for the branch protection | |
if: always() | |
needs: | |
- coverage | |
- migration | |
- test_lint | |
- test_docs | |
- test_minimum_versions | |
- test_prereleases | |
- check_links | |
- check_release | |
- test_sdist | |
runs-on: ubuntu-latest | |
steps: | |
- name: Decide whether the needed jobs succeeded or failed | |
uses: re-actors/alls-green@release/v1 | |
with: | |
jobs: ${{ toJSON(needs) }} |