Merge pull request #870 from jupyterhub/pre-commit-ci-update-config #1083
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
# This is a GitHub workflow defining a set of jobs with a set of steps. | |
# ref: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions | |
# | |
name: Test | |
on: | |
pull_request: | |
paths-ignore: | |
- "docs/**" | |
- "**.md" | |
- ".github/workflows/*" | |
- "!.github/workflows/test.yaml" | |
push: | |
paths-ignore: | |
- "docs/**" | |
- "**.md" | |
- ".github/workflows/*" | |
- "!.github/workflows/test.yaml" | |
branches-ignore: | |
- "dependabot/**" | |
- "pre-commit-ci-update-config" | |
workflow_dispatch: | |
jobs: | |
run-pytest: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
strategy: | |
# Keep running even if one variation of the job fail | |
fail-fast: false | |
matrix: | |
# We run this job multiple times with different parameterization | |
# specified below, these parameters have no meaning on their own and | |
# gain meaning on how job steps use them. | |
# | |
# k3s-channel: https://update.k3s.io/v1-release/channels | |
# kubernetes_asyncio: https://github.com/tomplus/kubernetes_asyncio/tags | |
# | |
include: | |
# Tests with oldest supported Python, jupyterhub, k8s, and k8s client | |
# | |
# NOTE: If lower bounds are updated, also update our test for the | |
# lower bounds in pyproject.toml. | |
# | |
- python: "3.7" | |
k3s: v1.24 | |
test_dependencies: >- | |
jupyterhub==4.0.0 | |
kubernetes_asyncio==24.2.3 | |
# Test with modern python and k8s versions | |
- python: "3.11" | |
k3s: v1.27 | |
- python: "3.12" | |
k3s: v1.28 | |
# Test with latest python and JupyterHub in main branch | |
- python: "3.X" | |
k3s: latest | |
test_dependencies: git+https://github.com/jupyterhub/jupyterhub | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "${{ matrix.python }}" | |
- name: Install package and test dependencies | |
run: | | |
pip install -e ".[test]" ${{ matrix.test_dependencies }} | |
pip freeze | |
# Starts a k8s cluster with NetworkPolicy enforcement and installs both | |
# kubectl and helm. We won't need network policy enforcement or helm | |
# though. | |
# | |
# ref: https://github.com/jupyterhub/action-k3s-helm/ | |
- uses: jupyterhub/action-k3s-helm@v4 | |
with: | |
k3s-channel: ${{ matrix.k3s }} | |
metrics-enabled: false | |
traefik-enabled: false | |
docker-enabled: false | |
- name: Run pytest | |
run: | | |
pytest --cov kubespawner | |
# ref: https://github.com/jupyterhub/action-k8s-namespace-report | |
- name: Kubernetes namespace report | |
uses: jupyterhub/action-k8s-namespace-report@v1 | |
if: always() | |
# ref: https://github.com/codecov/codecov-action | |
- uses: codecov/codecov-action@v4 |