52 lines
1.6 KiB
YAML
52 lines
1.6 KiB
YAML
# The test gate. Deploy waits for this workflow by name (`.gitea/workflows/deploy.yml`
|
|
# triggers on `workflow_run: [Test]`), so renaming it here without renaming it there
|
|
# would leave `main` publishing without a suite. `tests/integration/test_deploy_workflows.py`
|
|
# asserts both halves of that link, and that the commands below are still the ones
|
|
# configured in `work_item/.work-item.yml`.
|
|
|
|
name: Test
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
concurrency:
|
|
# One run per branch; a newer push makes the older run's answer irrelevant.
|
|
group: test-${{ gitea.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
suites:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install exiftool
|
|
# The EXIF checkpoints are the safety invariant of every metadata stage; a run
|
|
# without exiftool would skip them for a reason the release gate accepts.
|
|
run: |
|
|
SUDO=
|
|
if [ "$(id -u)" -ne 0 ]; then SUDO=sudo; fi
|
|
$SUDO apt-get update
|
|
$SUDO apt-get install -y --no-install-recommends libimage-exiftool-perl
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Install the application and its test dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install -e '.[test]'
|
|
python -m playwright install --with-deps chromium
|
|
|
|
- name: Helper suite
|
|
run: work_item/scripts/python -m unittest discover -s work_item/tests -v
|
|
|
|
- name: Application suite
|
|
run: work_item/scripts/python -m pytest tests -q
|