Run 928 logged "--network and --net in the options will be ignored", so NetworkMode stayed the per-job bridge. The fix is a DOCKER-USER exception on the runner host (pizzabox), which accepts RELATED/ESTABLISHED traffic from br-f192811a98b7; verified 200 from a bridge container after adding it.
84 lines
2.8 KiB
YAML
84 lines
2.8 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
jobs:
|
|
unit:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run unit tests
|
|
run: npm run test:unit
|
|
|
|
e2e:
|
|
# A fork PR controls both the test files and these steps, so only same-repository
|
|
# PRs can be trusted with the E2E_PASSWORD secret.
|
|
if: github.event.pull_request.head.repo.full_name == github.repository
|
|
runs-on: ubuntu-latest
|
|
# Needs the DOCKER-USER exception on the runner host: ruv.wtf is a macvlan interface on a
|
|
# container there, so the reply to a bridge-networked job arrives on that container's bridge
|
|
# and Docker's inter-bridge isolation drops it. act_runner ignores --network in
|
|
# container.options, so the exception lives on the host.
|
|
env:
|
|
# Dedicated test account on the homeserver, not a personal one.
|
|
E2E_HOMESERVER: ruv.wtf
|
|
E2E_USER: giteaci
|
|
# Repo secret: E2E_PASSWORD. The test fails with a clear message when it is missing.
|
|
E2E_PASSWORD: ${{ secrets.E2E_PASSWORD }}
|
|
steps:
|
|
# .gitmodules uses a relative URL, so the runner resolves it against origin.
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
# The E2E run drives the vite dev server, so cinny's dependencies are needed too.
|
|
- name: Install dependencies (cinny)
|
|
working-directory: ./cinny
|
|
run: npm ci --prefer-offline
|
|
|
|
# Electron needs system libraries the runner image does not ship.
|
|
- name: Install system libraries for Electron
|
|
run: npx playwright install-deps
|
|
|
|
# The runner image has no xvfb and no fresh apt lists.
|
|
- name: Ensure a display for Electron
|
|
run: command -v xvfb-run >/dev/null || (sudo apt-get update && sudo apt-get install -y xvfb)
|
|
|
|
# The login form only renders after the auth-flows request succeeds, so an
|
|
# unreachable homeserver shows up as a 30s locator timeout. Fail fast instead.
|
|
- name: Homeserver reachable from the runner
|
|
run: curl -sS --max-time 20 -o /dev/null -w '%{http_code}\n' "https://$E2E_HOMESERVER/.well-known/matrix/client"
|
|
|
|
- name: Run login E2E
|
|
run: xvfb-run -a npm run test:e2e
|
|
|
|
# Gitea implements the v3 artifact protocol; v4 rejects it as GHES.
|
|
- name: Upload test artifacts
|
|
if: failure()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: e2e-artifacts
|
|
path: |
|
|
test-results
|
|
playwright-report
|