Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Playwright Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
env:
DOCKER_BUILDKIT: 1
jobs:
browser-test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm install -g pnpm && pnpm install
working-directory: ui
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
working-directory: ui
- name: Build Docker image
run: docker buildx build --tag podreplay .
- name: Run Playwright tests
run: docker version && pnpm exec playwright test
working-directory: ui
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: ui/playwright-report/
retention-days: 30
17 changes: 16 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,20 @@ COPY --from=frontend /usr/src/ui/build ./ui

COPY litestream.yml /etc/

CMD ./litestream restore -v -if-db-not-exists db.sqlite && \
# or "yes"
ENV CREATE_LOCAL_DB="no"

COPY <<EOF run.sh
#!/usr/bin/env bash
set -euxo pipefail
if [ "\$CREATE_LOCAL_DB" = "yes" ]; then
echo "Using local DB"
CREATE_LOCAL_DB=yes ./podreplay
else
echo "Restoring DB from backup"
./litestream restore -v -if-db-not-exists db.sqlite && \
./litestream replicate -exec "./podreplay"
fi
EOF
RUN chmod +x run.sh
CMD ["./run.sh"]
Loading