Files
zerobyte/.github/workflows/e2e.yml
dependabot[bot] 36b17d73eb chore(deps): bump actions/upload-artifact from 5 to 6 (#353)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-16 18:20:33 +01:00

88 lines
2.6 KiB
YAML

name: E2E Tests
permissions:
contents: read
on:
workflow_dispatch:
workflow_call:
jobs:
playwright:
name: Playwright
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install dependencies
uses: "./.github/actions/install-dependencies"
- name: Get Playwright version
id: playwright-version
shell: bash
run: |
playwright_version=$(bun -e "console.log((await Bun.file('./package.json').json()).devDependencies['@playwright/test'])")
echo "version=$playwright_version" >> $GITHUB_OUTPUT
- name: Cache Playwright Browsers
id: playwright-cache
uses: actions/cache@v5
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Install Playwright Browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: bunx playwright install --with-deps
- name: Install Playwright System Dependencies
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: bunx playwright install-deps
- name: Prepare environment
run: |
mkdir -p data
mkdir -p playwright/temp
mkdir -p playwright/data
chmod -R 777 playwright/temp
touch .env.local
echo "SERVER_IP=localhost" >> .env.local
echo "DATABASE_URL=./data/zerobyte.db" >> .env.local
- name: Start zerobyte-e2e service
run: bun run start:e2e -- -d
- name: Wait for zerobyte to be ready
run: |
timeout 30s bash -c 'until curl -f http://localhost:4096/healthcheck; do echo "Waiting for server..." && sleep 2; done'
- name: Make playwright directory writable
run: sudo chmod 777 playwright/data/zerobyte.db
- name: Run Playwright tests
run: bun run test:e2e
- name: Dump container logs in playwright-report folder
if: always()
run: |
tree playwright
docker logs zerobyte > playwright-report/container-logs.txt || true
- name: Debug - print content of /test-data in container
if: failure()
run: |
docker exec zerobyte /bin/ash -c "ls -la /test-data" || true
- uses: actions/upload-artifact@v6
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 5
- name: Stop Docker Compose
if: always()
run: docker compose down