Skip to content

Test python 3.12, redis 7, traefik 3 - and misc updates to align with jupyterhub-python-repo-template #282

Test python 3.12, redis 7, traefik 3 - and misc updates to align with jupyterhub-python-repo-template

Test python 3.12, redis 7, traefik 3 - and misc updates to align with jupyterhub-python-repo-template #282

Workflow file for this run

# 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: |
export PATH="$PWD/bin:$PATH"
echo "PATH=$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