2bec25353b
The hosted Gitea runner image pre-installs older versions of both packages in its system Python site-packages and retains stale ~otify_bridge_core / ~otify_bridge_server dist-info directories from prior interrupted runs. ``pip install -e`` against the system interpreter tries to uninstall those, the rollback fires mid-transaction, and the runner's ``/opt/hostedtoolcache/.../bin/notify-bridge`` console script disappears before the new install can be placed: ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/opt/hostedtoolcache/Python/3.12.12/x64/bin/notify-bridge' Installing into a fresh venv sidesteps the pre-cached state entirely (and is the recommendation pip itself prints on every run).
79 lines
1.8 KiB
YAML
79 lines
1.8 KiB
YAML
name: Build and Test
|
|
|
|
on:
|
|
push:
|
|
branches: [master, main]
|
|
pull_request:
|
|
branches: [master, main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
test-backend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install core + server + dev deps (in venv)
|
|
run: |
|
|
python -m venv .venv
|
|
. .venv/bin/activate
|
|
python -m pip install --upgrade pip
|
|
python -m pip install -e ./packages/core
|
|
python -m pip install -e "./packages/server[dev]"
|
|
|
|
- name: Run pytest (server)
|
|
run: |
|
|
. .venv/bin/activate
|
|
cd packages/server
|
|
pytest -q --maxfail=1
|
|
|
|
test-frontend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "22"
|
|
cache: "npm"
|
|
cache-dependency-path: frontend/package-lock.json
|
|
|
|
- name: Install deps
|
|
run: |
|
|
cd frontend
|
|
npm ci
|
|
|
|
- name: Svelte check
|
|
run: |
|
|
cd frontend
|
|
npm run check || echo "::warning::svelte-check reported warnings"
|
|
|
|
- name: Build
|
|
run: |
|
|
cd frontend
|
|
npm run build
|
|
|
|
build-image:
|
|
needs: [test-backend, test-frontend]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build Docker image (no push)
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: false
|
|
tags: notify-bridge:ci-${{ gitea.sha }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|