-
Notifications
You must be signed in to change notification settings - Fork 305
96 lines (85 loc) · 2.9 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# 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