-
Notifications
You must be signed in to change notification settings - Fork 306
115 lines (99 loc) · 3.18 KB
/
test.yml
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# This is a GitHub workflow defining a set of jobs with a set of steps.
# ref: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions
#
name: Tests
on:
pull_request:
push:
workflow_dispatch:
jobs:
# Run tests
test:
runs-on: ubuntu-20.04
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- python: 3.8
test: internal-ssl
- python: 3.8
jupyterhub: 2.0
- python: 3.9
jupyterhub: 2.2
- python: "3.10"
jupyterhub: "2.1"
test: podman
- python: 3.9
jupyterhub: 3.1.1
- python: 3.11
jupyterhub: 3.1.1
steps:
- uses: actions/checkout@v2
- name: setup docker swarm
run: docker swarm init
- name: Install Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
# preserve pip cache to speed up installation
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('*requirements.txt') }}
- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install --upgrade --pre -r dev-requirements.txt
if [[ ! -z "${{ matrix.jupyterhub }}" ]]; then
pip install jupyterhub==${{ matrix.jupyterhub }}.*
fi
pip install -e .
pip freeze
- name: Install Node
uses: actions/setup-node@v1
with:
node-version: "14"
- name: Install Node dependencies
run: |
npm install -g configurable-http-proxy
- name: Pull images
if: matrix.test != 'podman'
run: |
for v in 1.0 1.1 1.2 1.3; do
docker pull jupyterhub/singleuser:$v
# preserve the layers with a different tag
docker tag jupyterhub/singleuser:$v jupyterhub/singleuser:${v}-cache
# untag so that pull actions are still required
docker rmi jupyterhub/singleuser:$v
done
- name: Run tests
if: matrix.test != 'internal-ssl' && matrix.test != 'podman'
run: |
py.test --cov dockerspawner tests -v
- name: Run internal-ssl tests
if: matrix.test == 'internal-ssl'
run: |
cd examples/internal-ssl
pytest -vsx
- name: Run user-mode podman tests
if: matrix.test == 'podman'
run: |
sudo systemctl stop docker
# Default is unix://$XDG_RUNTIME_DIR/podman/podman.sock but XDG_RUNTIME_DIR may not be set
export DOCKER_HOST=unix://$HOME/podman.sock
podman system service --time=0 $DOCKER_HOST &
for n in $(seq 1 10); do
if ! docker version; then
sleep 2
else
break
fi
done
docker ps
py.test --cov dockerspawner tests/test_dockerspawner.py -v
- name: Submit codecov report
run: |
codecov