`runs-on: ubuntu-latest` stays what it is everywhere else — a disposable container — and `docker-compose.ci.yml` is now what makes that true: the label maps to `catthehacker/ubuntu:act-24.04`, job containers share the runner's network so the cache server is reachable at all, and the host's docker socket is passed through (`docker_host: automount`) so the image workflow can build. The failure this is replacing is worth naming, because the symptom does not point at it: with a **host**-mode runner answering the same label, every job runs directly on the server as the runner's own user, so the workflows' `apt-get install` steps fail on permissions — and had they succeeded, CI would have been installing packages on a host. A workflow cannot tell which kind of runner it got; only the label map can say. `docs/gitea-runner.md` is the separate guide: why docker mode, the prerequisites including Gitea's two `app.ini` settings, the install, how to remove a host-mode runner (and what to check before you do, since a runner is shared), how to verify a job really is in a container, why labels cannot be changed without re-registering, and a table of the failures with their causes. Also `workflow_dispatch` on the test workflow, so a fresh runner can be proved from the UI without inventing a commit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
102 lines
3.2 KiB
YAML
102 lines
3.2 KiB
YAML
# The suites, on every push and pull request.
|
|
#
|
|
# All four are offline by design: the backend only ever runs on one machine, so
|
|
# nothing here may need it up. Fixtures and fakes, never a live server.
|
|
#
|
|
# `ubuntu-latest` is whatever the runner's label map points at — see
|
|
# `docker-compose.ci.yml`, which pins it to catthehacker/ubuntu:act-24.04 for the
|
|
# two things every job needs: a node (Gitea's javascript actions run inside the
|
|
# job container) and Python 3.12, which the backend requires.
|
|
name: tests
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
# So a new runner can be proved out from the UI without inventing a commit.
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
DEBIAN_FRONTEND: noninteractive
|
|
|
|
jobs:
|
|
backend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Python tooling
|
|
run: |
|
|
apt-get update -qq
|
|
apt-get install -y --no-install-recommends python3-venv >/dev/null
|
|
python3 -m venv /tmp/venv
|
|
/tmp/venv/bin/pip install -q -e "./backend[dev]"
|
|
|
|
- name: pytest
|
|
working-directory: backend
|
|
run: PYTHONPATH="$PWD" /tmp/venv/bin/python -m pytest -q
|
|
|
|
desktop:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# No PyQt6 and no display: nothing under desktop/tests imports Qt. The
|
|
# three modules it covers — the blocker manager, the DNS stub, the mini
|
|
# timer's geometry — are plain standard library, which is why they are
|
|
# testable at all. `pythonpath = ["."]` is already in the pytest config.
|
|
- name: Install pytest
|
|
run: |
|
|
apt-get update -qq
|
|
apt-get install -y --no-install-recommends python3-venv >/dev/null
|
|
python3 -m venv /tmp/venv
|
|
/tmp/venv/bin/pip install -q pytest
|
|
|
|
- name: pytest
|
|
working-directory: desktop
|
|
run: /tmp/venv/bin/python -m pytest -q
|
|
|
|
web:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/cache@v4
|
|
continue-on-error: true
|
|
with:
|
|
path: frontend/node_modules
|
|
key: npm-${{ hashFiles('frontend/package-lock.json') }}
|
|
|
|
- name: Install, typecheck, build
|
|
working-directory: frontend
|
|
run: |
|
|
npm ci --no-audit --no-fund
|
|
npm run typecheck
|
|
npm run build
|
|
|
|
android-core:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# `:core` is plain Kotlin on the JVM and `settings.gradle.kts` only
|
|
# includes `:app` when an SDK is present, so this job needs a JDK and
|
|
# nothing else. The `:app` unit tests run in the release workflow, where
|
|
# the SDK has to be installed anyway.
|
|
- name: Install JDK 21
|
|
run: |
|
|
apt-get update -qq
|
|
apt-get install -y --no-install-recommends openjdk-21-jdk-headless >/dev/null
|
|
|
|
- uses: actions/cache@v4
|
|
continue-on-error: true
|
|
with:
|
|
path: ~/.gradle/caches
|
|
key: gradle-core-${{ hashFiles('android/gradle/libs.versions.toml', 'android/gradle/wrapper/gradle-wrapper.properties') }}
|
|
|
|
- name: gradlew :core:test
|
|
working-directory: android
|
|
env:
|
|
JAVA_HOME: /usr/lib/jvm/java-21-openjdk-amd64
|
|
run: ./gradlew --no-daemon :core:test
|