mirror of
https://github.com/BradGroux/veritas-kanban.git
synced 2026-12-03 19:27:18 +00:00
Consolidate reviewed workflow action revisions from #1584, #1643, #1644, #1645, and #1646. Local policy tests and static checks passed. GitHub Actions remains disabled.
208 lines
6.3 KiB
YAML
208 lines
6.3 KiB
YAML
name: Scheduled QA
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
types: [opened, synchronize, reopened, labeled, unlabeled]
|
|
schedule:
|
|
- cron: '17 8 * * 1'
|
|
workflow_dispatch:
|
|
inputs:
|
|
load_profile:
|
|
description: k6 load profile to run
|
|
required: true
|
|
default: smoke
|
|
type: choice
|
|
options:
|
|
- smoke
|
|
- full
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: false
|
|
|
|
env:
|
|
NODE_VERSION: '22'
|
|
K6_IMAGE: grafana/k6:1.7.1
|
|
LOG_LEVEL: warn
|
|
VERITAS_ADMIN_KEY: scheduled-qa-admin-key-000000000000
|
|
VERITAS_AUTH_LOCALHOST_BYPASS: 'true'
|
|
VERITAS_AUTH_LOCALHOST_ROLE: admin
|
|
VERITAS_JWT_SECRET: scheduled-qa-jwt-secret-00000000000000000000000000000000
|
|
VERITAS_STORAGE: sqlite
|
|
RATE_LIMIT_MAX: '100000'
|
|
RATE_LIMIT_WRITE_MAX: '100000'
|
|
|
|
jobs:
|
|
playwright:
|
|
name: Playwright E2E (${{ matrix.shard }}/2)
|
|
if: >-
|
|
github.event_name != 'pull_request' ||
|
|
contains(github.event.pull_request.labels.*.name, 'ci:full')
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 25
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
shard: [1, 2]
|
|
steps:
|
|
- name: Record milestone selection
|
|
run: |
|
|
{
|
|
echo "### Playwright E2E milestone"
|
|
echo
|
|
echo "- Shard: ${{ matrix.shard }}/2 (isolated runner, one worker)"
|
|
echo "- Trigger: \`$GITHUB_EVENT_NAME\`"
|
|
echo "- Reason: explicit \`ci:full\`, scheduled, or manual milestone"
|
|
} >> "$GITHUB_STEP_SUMMARY"
|
|
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
|
|
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
|
|
|
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
cache: pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Configure isolated Playwright data directory
|
|
run: |
|
|
echo "VERITAS_DATA_DIR=$RUNNER_TEMP/veritas-playwright-data" >> "$GITHUB_ENV"
|
|
mkdir -p "$RUNNER_TEMP/veritas-playwright-data"
|
|
|
|
- name: Build shared package
|
|
run: pnpm --filter @veritas-kanban/shared build
|
|
|
|
- name: Install Playwright browsers
|
|
run: pnpm exec playwright install --with-deps chromium webkit
|
|
|
|
- name: Run Playwright E2E tests
|
|
env:
|
|
PLAYWRIGHT_HTML_REPORT: '1'
|
|
PLAYWRIGHT_HTML_OPEN: never
|
|
run: pnpm test:e2e --shard=${{ matrix.shard }}/2
|
|
|
|
- name: Upload Playwright artifacts
|
|
if: always()
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: playwright-artifacts-${{ matrix.shard }}
|
|
path: |
|
|
playwright-report/
|
|
test-results/
|
|
if-no-files-found: ignore
|
|
retention-days: 7
|
|
|
|
k6:
|
|
name: k6 Load Smoke
|
|
if: >-
|
|
github.event_name != 'pull_request' ||
|
|
contains(github.event.pull_request.labels.*.name, 'ci:full')
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
env:
|
|
K6_PROFILE: ${{ github.event_name == 'workflow_dispatch' && inputs.load_profile || 'smoke' }}
|
|
steps:
|
|
- name: Record milestone selection
|
|
run: |
|
|
{
|
|
echo "### k6 milestone"
|
|
echo
|
|
echo "- Trigger: \`$GITHUB_EVENT_NAME\`"
|
|
echo "- Profile: \`$K6_PROFILE\`"
|
|
echo "- Reason: explicit \`ci:full\`, scheduled, or manual milestone"
|
|
} >> "$GITHUB_STEP_SUMMARY"
|
|
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
|
|
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
|
|
|
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
cache: pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Configure isolated k6 data directory
|
|
run: |
|
|
echo "VERITAS_DATA_DIR=$RUNNER_TEMP/veritas-k6-data" >> "$GITHUB_ENV"
|
|
mkdir -p "$RUNNER_TEMP/veritas-k6-data"
|
|
|
|
- name: Build runtime packages
|
|
run: pnpm build
|
|
|
|
- name: Start API server
|
|
run: |
|
|
mkdir -p "$VERITAS_DATA_DIR"
|
|
pnpm --filter @veritas-kanban/server start > "$RUNNER_TEMP/veritas-server.log" 2>&1 &
|
|
echo "$!" > "$RUNNER_TEMP/veritas-server.pid"
|
|
|
|
- name: Wait for API health
|
|
run: |
|
|
for _ in $(seq 1 60); do
|
|
if curl -fsS http://127.0.0.1:3001/api/health > /dev/null; then
|
|
exit 0
|
|
fi
|
|
sleep 2
|
|
done
|
|
|
|
cat "$RUNNER_TEMP/veritas-server.log"
|
|
exit 1
|
|
|
|
- name: Run k6 profile
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
mkdir -p k6-results
|
|
chmod 0777 k6-results
|
|
|
|
if [ "$K6_PROFILE" = "full" ]; then
|
|
scripts="smoke read-load write-load mixed-load ws-stress v5-remote-mix"
|
|
else
|
|
scripts="smoke"
|
|
fi
|
|
|
|
for script in $scripts; do
|
|
docker run --rm --network host \
|
|
-e BASE_URL=http://127.0.0.1:3001 \
|
|
-e WS_URL=ws://127.0.0.1:3001/ws \
|
|
-e API_KEY="$VERITAS_ADMIN_KEY" \
|
|
-e V5_SEED_TASKS=120 \
|
|
-e V5_SEED_CHATS=12 \
|
|
-e V5_HTTP_VUS=20 \
|
|
-e V5_WS_VUS=30 \
|
|
-e V5_DURATION=45s \
|
|
-e V5_WS_HOLD_MS=40000 \
|
|
-v "$PWD:/work" \
|
|
-w /work \
|
|
"$K6_IMAGE" run \
|
|
--summary-export "k6-results/${script}.json" \
|
|
"load-tests/k6/${script}.js" 2>&1 | tee "k6-results/${script}.log"
|
|
done
|
|
|
|
- name: Stop API server
|
|
if: always()
|
|
run: |
|
|
if [ -f "$RUNNER_TEMP/veritas-server.pid" ]; then
|
|
kill "$(cat "$RUNNER_TEMP/veritas-server.pid")" || true
|
|
fi
|
|
|
|
- name: Upload k6 artifacts
|
|
if: always()
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: k6-artifacts
|
|
path: |
|
|
k6-results/
|
|
${{ runner.temp }}/veritas-server.log
|
|
if-no-files-found: ignore
|
|
retention-days: 7
|