Tests / Run the tests (pull_request) Canceled after 0s
Closes #2 Closes #3 Closes #4 Closes #5 Closes #6 Refs #7 Task: MIL-001#1 Task: MIL-001#2 Task: MIL-001#3 Task: MIL-001#4 Task: MIL-001#5 Task: MIL-001#6
47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
# Continuous integration for the squirrel census project: runs the pytest tests
|
|
# on Python 3.13 for every push and pull request. Read by Gitea Actions (a
|
|
# runner must be registered for the repository). It changes nothing outside the
|
|
# repository and uses no secret. Decision: MIL-001 task "Add CI workflow".
|
|
# Host: Gitea Actions; uses only github.* contexts, so it also runs on GitHub.
|
|
|
|
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
PYTHON_VERSION: "3.13"
|
|
PIP_VERSION: "26.2.1"
|
|
|
|
concurrency:
|
|
group: tests-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
pytest:
|
|
name: Run the tests
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- name: Check out the code
|
|
uses: actions/checkout@v4.2.2
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5.6.0
|
|
with:
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
|
|
- name: Create the virtual environment and install
|
|
run: |
|
|
python -m venv .venv
|
|
.venv/bin/python -m pip install --upgrade "pip==${PIP_VERSION}"
|
|
.venv/bin/python -m pip install -e ".[dev]"
|
|
|
|
- name: Run the tests
|
|
run: .venv/bin/python -m pytest
|