Files
the-littlest-jupyterhub/.github/workflows/unit-test.yaml
dependabot[bot] f1c7e2d90f build(deps): bump actions/setup-python from 4 to 5
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-01 05:51:55 +00:00

97 lines
2.9 KiB
YAML

# 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: Unit tests
on:
pull_request:
paths-ignore:
- "docs/**"
- "**.md"
- ".github/workflows/*"
- "!.github/workflows/unit-test.yaml"
push:
paths-ignore:
- "docs/**"
- "**.md"
- ".github/workflows/*"
- "!.github/workflows/unit-test.yaml"
branches-ignore:
- "dependabot/**"
- "pre-commit-ci-update-config"
workflow_dispatch:
jobs:
unit-tests:
name: ${{ matrix.name }}
# runs-on can only be configured to the LTS releases of ubuntu (18.04,
# 20.04, ...), so if we want to test against the latest non-LTS release, we
# must compromise when configuring runs-on and configure runs-on to be the
# latest LTS release instead.
#
# This can have consequences because actions like actions/setup-python will
# mount cached installations associated with the chosen runs-on environment.
#
runs-on: ${{ format('ubuntu-{0}', matrix.runs_on || matrix.ubuntu_version) }}
container: ubuntu:${{ matrix.ubuntu_version }}
strategy:
fail-fast: false
matrix:
include:
- name: "Ubuntu 20.04, Py 3.9"
ubuntu_version: "20.04"
python_version: "3.9"
- name: "Ubuntu 22.04, Py 3.10"
ubuntu_version: "22.04"
python_version: "3.10"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python_version }}"
- name: Install venv, git and setup venv
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install --yes \
python3-venv \
bzip2 \
git
python3 -m venv /srv/venv
echo '/srv/venv/bin' >> $GITHUB_PATH
# WARNING: This action loads a cache of pip dependencies based on the
# declared key, and it will save a cache for that key on job
# completion. Make sure to update the key to bust the cache
# properly if you make a change that should influence it.
- name: Load cached Python dependencies
uses: actions/cache@v3
with:
path: /srv/venv/
key: >-
pip-
${{ matrix.runs_on }}-
${{ matrix.ubuntu_version }}-
${{ matrix.python_version }}-
${{ hashFiles('setup.py', 'dev-requirements.txt', '.github/workflows/unit-test.yaml') }}
- name: Install Python dependencies
run: |
pip install -r dev-requirements.txt
pip install -e .
- name: List Python dependencies
run: |
pip freeze
- name: Run unit tests
run: pytest tests
timeout-minutes: 15
- uses: codecov/codecov-action@v3