Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/scripts/fetch-seerrng-files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Copies the SeerrNG files Lumen builds against (src/, server/, config/, package.json,
# tsconfig.json) from the commit named in UPSTREAM into the workspace root.
set -euo pipefail
sha="$(tr -d '[:space:]' < UPSTREAM)"
[[ "$sha" =~ ^[0-9a-f]{40}$ ]] || { echo "UPSTREAM does not hold a commit id"; exit 1; }
up="${RUNNER_TEMP:-/tmp}/seerrng-upstream"
rm -rf "$up"
git init -q "$up"
git -C "$up" remote add origin https://github.com/snapetech-org/seerrng.git
git -C "$up" sparse-checkout set --no-cone /src/ /server/ /config/ /package.json /tsconfig.json
git -C "$up" fetch -q --depth 1 --filter=blob:none origin "$sha"
git -C "$up" checkout -q FETCH_HEAD
cp -r "$up/src" "$up/server" "$up/config" "$up/package.json" "$up/tsconfig.json" "${GITHUB_WORKSPACE:-$PWD}/"
echo "Using snapetech-org/seerrng@${sha::8}"
82 changes: 65 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,94 @@
# Builds Lumen and runs its type check, unit tests and browser tests (desktop, iPhone,
# Android and tablet) for every pull request that touches lumen/, and after each sync.
# Builds Lumen and runs its type check, unit tests and browser tests (desktop, phone and
# tablet) for every pull request that touches lumen/, and after each sync.
#
# Lumen imports a few SeerrNG files from outside lumen/ (the @app and @server aliases, shared
# translations, the issue constants), and its image build copies them in. This repo only
# mirrors lumen/, so each job first fetches src/, server/, config/ and the root package.json
# and tsconfig.json from the SeerrNG commit named in UPSTREAM, the one lumen/ was synced from.
#
# The browser suite runs in four shards so each one finishes well inside the job limit.
name: Lumen tests

on:
pull_request:
paths:
- 'lumen/**'
- 'UPSTREAM'
- '.github/workflows/test.yml'
- '.github/scripts/fetch-seerrng-files.sh'
push:
branches: [main]
paths:
- 'lumen/**'
- 'UPSTREAM'
workflow_dispatch:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: lumen
checks:
name: Type check, build, unit and image tests
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4

with:
persist-credentials: false
- name: Fetch the SeerrNG files Lumen builds against
run: bash .github/scripts/fetch-seerrng-files.sh
- uses: actions/setup-node@v4
with:
node-version: 24
node-version-file: package.json
cache: npm
cache-dependency-path: lumen/package-lock.json
- name: Install Lumen dependencies
working-directory: lumen
run: npm ci --ignore-scripts
- name: Type check
working-directory: lumen
run: npx tsc --noEmit -p .
- name: Build Lumen
working-directory: lumen
run: npm run build
- name: Unit, image and proxy tests
working-directory: lumen
run: npm test

- run: npm ci
- run: npx tsc --noEmit -p .
- run: npm run build
- run: npm test
- run: npx playwright install --with-deps chromium webkit
- run: npx playwright test

browser:
name: Browser tests (shard ${{ matrix.shard }}/4)
runs-on: ubuntu-24.04
timeout-minutes: 75
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Fetch the SeerrNG files Lumen builds against
run: bash .github/scripts/fetch-seerrng-files.sh
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: npm
cache-dependency-path: lumen/package-lock.json
- name: Install Lumen dependencies
working-directory: lumen
run: npm ci --ignore-scripts
- name: Build Lumen
working-directory: lumen
run: npm run build
- name: Install Chromium
working-directory: lumen
run: npx --no-install playwright install --with-deps chromium
- name: Browser tests in desktop, phone and tablet viewports
working-directory: lumen
run: npm run test:browser -- --workers=2 --shard=${{ matrix.shard }}/4
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-results
name: playwright-results-${{ matrix.shard }}
path: lumen/test-results
retention-days: 7
Loading