Skip to content

Add a view-only live view member profile #1925

Add a view-only live view member profile

Add a view-only live view member profile #1925

Workflow file for this run

name: Test for the server/ directory
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-headful:
uses: ./.github/workflows/chromium-headful-image.yaml
secrets: inherit
build-headless:
uses: ./.github/workflows/chromium-headless-image.yaml
secrets: inherit
test-server-unit:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "server/go.mod"
cache: true
cache-dependency-path: server/go.sum
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
# categorygen's checks (unclassified route, category that isn't control or
# platform, classified route with no handler) only run when the generator
# does, and its only other caller is `make oapi-generate`, which needs the
# npm down-converter. Running it here enforces them on every change.
- name: Check generated event categories are current
run: |
go generate ./lib/events/...
git diff --exit-code -- lib/events/category_gen.go
working-directory: server
- name: Install recording regression dependencies
run: sudo apt-get update && sudo apt-get install -y ffmpeg
- name: Run server unit tests
run: make test-unit
working-directory: server
- name: Run Playwright daemon unit tests
run: make test-runtime
working-directory: server
test-server-e2e:
runs-on: ubuntu-latest
needs: [build-headful, build-headless]
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Chrome
uses: browser-actions/setup-chrome@v2
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Add pnpm to PATH
run: |
echo "$PNPM_HOME" >> "$GITHUB_PATH"
export PATH="$PNPM_HOME:$PATH"
pnpm --version
- name: Install Playwright e2e dependencies
run: pnpm install --frozen-lockfile
working-directory: server/e2e/playwright
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "server/go.mod"
cache: true
cache-dependency-path: server/go.sum
- name: Run CDP telemetry browser regressions
run: go test -race ./lib/cdpmonitor -run '^(TestNetworkCapture|TestNetworkWireCapture|TestNetworkBodiesSurviveNavigation|TestNetworkExtensionAttribution|TestTelemetryConnection|TestProxyErrorE2E)' -count=1 -v
working-directory: server
env:
KERNEL_CDPMONITOR_CHROME_E2E: "1"
- name: Run WebAuthn page hook browser tests
run: go test -race ./lib/webauthnhook -run '^TestChromiumPageHook$' -count=1 -v
working-directory: server
env:
KERNEL_WEBAUTHN_CHROME_E2E: "1"
- name: Compute short SHA for images
id: vars
shell: bash
run: echo "short_sha=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Pull e2e images
shell: bash
run: |
set -euo pipefail
docker pull "$E2E_CHROMIUM_HEADFUL_IMAGE" &
headful_pid=$!
docker pull "$E2E_CHROMIUM_HEADLESS_IMAGE" &
headless_pid=$!
wait "$headful_pid"
wait "$headless_pid"
env:
E2E_CHROMIUM_HEADFUL_IMAGE: onkernel/chromium-headful:${{ steps.vars.outputs.short_sha }}
E2E_CHROMIUM_HEADLESS_IMAGE: onkernel/chromium-headless:${{ steps.vars.outputs.short_sha }}
- name: Run server e2e tests
run: make test-e2e
working-directory: server
env:
E2E_CHROMIUM_HEADFUL_IMAGE: onkernel/chromium-headful:${{ steps.vars.outputs.short_sha }}
E2E_CHROMIUM_HEADLESS_IMAGE: onkernel/chromium-headless:${{ steps.vars.outputs.short_sha }}
RECORDING_AUDIO_OUTPUT_PATH: ${{ runner.temp }}/replay-audio/recording.mp4
- name: Upload replay audio diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: replay-audio-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/replay-audio/
retention-days: 14
if-no-files-found: warn