mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 10:01:00 +01:00
* ci: bound apt network timeouts for Playwright's dependency install `npx playwright install --with-deps` runs its own `apt-get update`, so the `-o` flags from #5181 could not reach it, and a stalled Ubuntu mirror hung the frontend test job until the 15 minute limit cancelled it. Move the retry/timeout options into an apt.conf.d file written by a small composite action, used by setup-backend and the frontend test job. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * ci: install Playwright's headless shell without apt The apt.conf.d timeouts did not stop the hang: on a runner whose Azure mirror is unreachable, apt falls back to archive.ubuntu.com and stalls while downloading the package indexes, slowly enough that no timeout fires. The ubuntu-latest image already ships Chrome's system libraries, so drop --with-deps from the frontend and e2e jobs and keep apt out of their path. Revert the bound-apt-timeouts action, and run the frontend checks when frontend.yml itself changes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * ci: install setup-backend's apt packages from a cache The MariaDB connector .debs (plus each job's extra apt packages) were fetched from an Ubuntu mirror on every backend job, so a stalled mirror could hang any of them until the 15 minute limit, the same way it hung Playwright's dependency install. Cache the downloaded .debs keyed on the runner image OS and package list, saved from master only, and install from them without apt-get update on a hit. A miss still downloads them with the #5181 retry and timeout options. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * ci: install cached apt packages without re-downloading them With package lists present, apt fetched the mirror's copy of each local .deb instead of installing the file, so even the cached path reached the mirror. Point apt's archives dir at the .deb directory and pass --no-download. Also read ImageOS in a shell step: it is a runner shell variable, not in the `env` context, so the cache key came out empty. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * ci: pin workflow runners to ubuntu-24.04 The apt .deb cache in setup-backend only holds packages built for one Ubuntu release. Pin every job to ubuntu-24.04 so a GitHub move of ubuntu-latest can't restore noble packages onto a newer image, and hardcode the release in the cache key instead of reading ImageOS. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
73 lines
2.2 KiB
YAML
73 lines
2.2 KiB
YAML
name: Run mypy
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "backend/**"
|
|
- ".github/scripts/**.py"
|
|
- "frontend/src/locales/*.py"
|
|
- ".github/workflows/mypy.yml"
|
|
- ".trunk/configs/mypy.ini"
|
|
- pyproject.toml
|
|
- uv.lock
|
|
- .python-version
|
|
push:
|
|
branches:
|
|
- "master"
|
|
paths:
|
|
- "backend/**"
|
|
- ".github/scripts/**.py"
|
|
- "frontend/src/locales/*.py"
|
|
- ".github/workflows/mypy.yml"
|
|
- ".trunk/configs/mypy.ini"
|
|
- pyproject.toml
|
|
- uv.lock
|
|
- .python-version
|
|
|
|
# A new push cancels a PR's superseded run; each master commit keeps its own.
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
mypy:
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up the backend
|
|
uses: ./.github/actions/setup-backend
|
|
with:
|
|
sync-args: --extra dev --extra test
|
|
|
|
# mypy revalidates each cached module against its source and options, so
|
|
# any earlier master cache is safe to seed from.
|
|
- name: Restore the mypy cache
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: .mypy_cache
|
|
key: mypy-${{ runner.os }}-${{ github.sha }}
|
|
restore-keys: mypy-${{ runner.os }}-
|
|
|
|
# The scripts import the app from backend/, as they add it to sys.path.
|
|
- name: Type check the backend and the scripts outside it
|
|
env:
|
|
MYPYPATH: backend
|
|
run: |
|
|
uv run mypy --config-file .trunk/configs/mypy.ini backend .github/scripts frontend/src/locales
|
|
|
|
# Only master writes the cache, so a PR can't evict or seed it.
|
|
- name: Save the mypy cache
|
|
if: github.ref == 'refs/heads/master'
|
|
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: .mypy_cache
|
|
key: mypy-${{ runner.os }}-${{ github.sha }}
|