-
Notifications
You must be signed in to change notification settings - Fork 30
100 lines (87 loc) · 2.89 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
# 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: Run tests
on:
pull_request:
paths-ignore:
- "docs/**"
- "**.md"
- "**.rst"
- ".github/workflows/*"
- "!.github/workflows/test.yml"
push:
paths-ignore:
- "docs/**"
- "**.md"
- "**.rst"
- ".github/workflows/*"
- "!.github/workflows/test.yml"
branches-ignore:
- "dependabot/**"
- "pre-commit-ci-update-config"
workflow_dispatch:
env:
ETCDCTL_API: "3"
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python
ETCD_DOWNLOAD_VERSION: "3.4.24"
CONSUL_VERSION: "1.14.4"
jobs:
# Run "pytest tests" for various Python versions
pytest:
runs-on: ubuntu-20.04
timeout-minutes: 30
strategy:
# Keep running even if one variation of the job fail
fail-fast: false
matrix:
include:
- python: "3.8"
backend: "etcd"
- python: "3.9"
backend: "consul"
- python: "3.10"
- python: "3.11"
- python: "3.12"
- python: "3.12"
traefik-version: v3.0.0-beta5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Python dependencies
run: |
pip install --upgrade setuptools pip
pip install -r dev-requirements.txt -e .
- name: List Python dependencies
run: |
pip freeze
- name: Install traefik
run: |
echo "PATH=$PWD/bin:$PATH" >> $GITHUB_ENV
TRAEFIK_VERSION=
if [[ ! -z "${{ matrix.traefik-version }}" ]]; then
TRAEFIK_VERSION=--traefik-version=${{ matrix.traefik-version }}
fi
python -m jupyterhub_traefik_proxy.install --output=./bin ${TRAEFIK_VERSION}
traefik version
- name: Install etcd, consul
run: |
curl -L https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip > consul.zip
unzip consul.zip -d ./bin consul
curl -L https://github.com/etcd-io/etcd/releases/download/v${ETCD_DOWNLOAD_VERSION}/etcd-v${ETCD_DOWNLOAD_VERSION}-linux-amd64.tar.gz > etcd.tar.gz
tar -xzf etcd.tar.gz -C ./bin --strip-components=1 --wildcards '*/etcd*'
- name: Select tests
run: |
if [[ ! -z "${{ matrix.backend }}" ]]; then
# select backend subset
echo "PYTEST_ADDOPTS=-k ${{ matrix.backend }}" >> "${GITHUB_ENV}"
else
# default: select everything _but_ the etcd/consul backend tests
echo "PYTEST_ADDOPTS=-k 'not etcd and not consul'" >> "${GITHUB_ENV}"
fi
- name: Run tests
run: |
pytest
- uses: codecov/codecov-action@v3