mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-08 06:22:31 -05:00
The test failed intermittently in CI with a 500 from POST /art/new.data: the sendou bucket was missing for the whole run, so the upload threw NoSuchBucket. art.spec.ts is the only e2e test that writes to S3, which is why it was the only casualty.
75 lines
1.8 KiB
YAML
75 lines
1.8 KiB
YAML
name: E2E Tests
|
|
|
|
on:
|
|
pull_request:
|
|
paths-ignore:
|
|
- 'content/**'
|
|
- 'public/**'
|
|
- 'locales/**'
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- 'content/**'
|
|
- 'public/**'
|
|
- 'locales/**'
|
|
|
|
jobs:
|
|
e2e:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Start MinIO
|
|
run: docker compose up -d minio
|
|
|
|
# the bucket, not the health endpoint: MinIO answers health/live while it is still
|
|
# bootstrapping, so a run whose bucket never got created would only surface much later
|
|
# as a 500 in the one test that uploads an image
|
|
- name: Wait for MinIO to be ready
|
|
run: |
|
|
for i in {1..30}; do
|
|
if curl -sf -o /dev/null http://127.0.0.1:9000/sendou/; then
|
|
echo "MinIO is ready"
|
|
exit 0
|
|
fi
|
|
echo "Waiting for MinIO... ($i/30)"
|
|
sleep 2
|
|
done
|
|
echo "MinIO failed to start"
|
|
exit 1
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'pnpm'
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Install Playwright browsers
|
|
run: pnpm exec playwright install --with-deps
|
|
|
|
- name: Run E2E tests
|
|
run: pnpm run test:e2e
|
|
|
|
- name: Stop MinIO
|
|
if: always()
|
|
run: docker compose down
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
if: failure()
|
|
with:
|
|
name: playwright-report
|
|
path: playwright-report/
|
|
retention-days: 30
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
if: failure()
|
|
with:
|
|
name: playwright-traces
|
|
path: test-results/
|
|
retention-days: 30
|