Skip to content

Milestone 21c: STIG Library detail — rules per revision + revision picker #33

Milestone 21c: STIG Library detail — rules per revision + revision picker

Milestone 21c: STIG Library detail — rules per revision + revision picker #33

Workflow file for this run

name: e2e
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: e2e-${{ github.ref }}
cancel-in-progress: true
env:
NODE_VERSION: '24'
PNPM_VERSION: '9'
jobs:
playwright:
name: playwright
runs-on: ubuntu-24.04
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Install workspace deps
run: pnpm install --frozen-lockfile
- name: Install Playwright browsers
working-directory: e2e
run: pnpm exec playwright install --with-deps chromium
- name: Bring up compose stack
working-directory: deploy/compose
run: |
set -e
docker compose -f docker-compose.yaml up -d --build
- name: Wait for stack to be ready
run: |
set -e
for i in $(seq 1 90); do
kc=$(curl -sf -o /dev/null -w "%{http_code}" http://localhost:8080/realms/stigman/.well-known/openid-configuration || echo 000)
api=$(curl -sf -o /dev/null -w "%{http_code}" http://localhost:54001/health || echo 000)
web=$(curl -sf -o /dev/null -w "%{http_code}" http://localhost:54000/ || echo 000)
echo "i=$i kc=$kc api=$api web=$web"
if [ "$kc" = "200" ] && [ "$api" = "200" ] && [ "$web" = "200" ]; then
exit 0
fi
sleep 2
done
echo "stack failed to become ready"
docker compose -f deploy/compose/docker-compose.yaml logs --tail=200
exit 1
- name: Run Playwright
working-directory: e2e
env:
CI: 'true'
WEB_URL: http://localhost:54000
API_URL: http://localhost:54001
run: pnpm test
- name: Collect compose logs on failure
if: failure()
working-directory: deploy/compose
run: |
mkdir -p ../../e2e/logs
docker compose -f docker-compose.yaml logs --no-color > ../../e2e/logs/compose.log
continue-on-error: true
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: |
e2e/playwright-report
e2e/test-results
e2e/logs
if-no-files-found: ignore
retention-days: 14
- name: Tear down compose stack
if: always()
working-directory: deploy/compose
run: docker compose -f docker-compose.yaml down -v --remove-orphans
continue-on-error: true