Skip to content

Replace scaffold E2E suite with OneShot lifecycle coverage and wire Playwright into CI #54

Replace scaffold E2E suite with OneShot lifecycle coverage and wire Playwright into CI

Replace scaffold E2E suite with OneShot lifecycle coverage and wire Playwright into CI #54

Workflow file for this run

name: CI
on:
push:
pull_request:
permissions:
contents: read
jobs:
api-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: oneshot
POSTGRES_PASSWORD: oneshot
POSTGRES_DB: oneshot_test
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U oneshot"
--health-interval=5s
--health-timeout=5s
--health-retries=10
env:
H4CKATH0N_DATABASE_URL: postgresql+asyncpg://oneshot:oneshot@localhost:5432/oneshot_test
defaults:
run:
working-directory: api
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- run: uv sync
- run: uv run pytest
web-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: oneshot
POSTGRES_PASSWORD: oneshot
POSTGRES_DB: oneshot_test
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U oneshot"
--health-interval=5s
--health-timeout=5s
--health-retries=10
env:
H4CKATH0N_DATABASE_URL: postgresql+asyncpg://oneshot:oneshot@localhost:5432/oneshot_test
H4CKATH0N_PASSWORD_AUTH_ENABLED: "false"
ONESHOT_ALLOW_PASSKEY_REGISTRATION_FOR_E2E: "true"
defaults:
run:
working-directory: web
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: web/package-lock.json
- run: uv sync
working-directory: api
- run: npm ci
- run: npm run test
- run: npx playwright install --with-deps chromium
- run: npx playwright test
container-packaging:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: api
context: ./api
dockerfile: ./api/Dockerfile
- name: web
context: ./web
dockerfile: ./web/Dockerfile
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
if: matrix.name == 'web'
with:
node-version: "20"
cache: "npm"
cache-dependency-path: web/package-lock.json
- name: Package frontend artifact
if: matrix.name == 'web'
run: bash scripts/ci/package_frontend.sh
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
push: false
tags: oneshot/${{ matrix.name }}:ci-${{ github.sha }}