Files
mealie/.github/workflows/e2e.yml
T

89 lines
2.8 KiB
YAML

name: E2E Tests
on:
workflow_call:
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./tests/e2e
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
with:
version: 11
- uses: actions/setup-node@v6
with:
node-version: 24
cache: "pnpm"
cache-dependency-path: "**/pnpm-lock.yaml"
- name: Install dependencies
run: pnpm install
# This install takes about 50 seconds and needs nothing the image build
# produces, so the two run at the same time.
- name: Start Playwright browser install
run: |
rm -f /tmp/playwright-install.status
nohup bash -c 'pnpm playwright install --with-deps; echo $? > /tmp/playwright-install.status' \
> /tmp/playwright-install.log 2>&1 &
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Retrieve Python package
uses: actions/download-artifact@v6
with:
name: backend-dist
path: dist
- name: Build Image
uses: docker/build-push-action@v7
with:
file: ./docker/Dockerfile
context: .
build-contexts: |
packages=dist
push: false
load: true
tags: mealie:e2e
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Deploy E2E Test Environment
run: |
docker compose up -d --wait
# The mock OIDC server has no shell, so compose cannot health check it.
for _ in $(seq 1 60); do
curl -fsS http://localhost:8080/default/.well-known/openid-configuration > /dev/null && exit 0
sleep 1
done
echo "the mock OIDC server did not answer"
exit 1
working-directory: ./tests/e2e/docker
- name: Finish Playwright browser install
run: |
for _ in $(seq 1 300); do
[ -f /tmp/playwright-install.status ] && break
sleep 1
done
cat /tmp/playwright-install.log
exit "$(cat /tmp/playwright-install.status 2>/dev/null || echo 1)"
- name: Check test environment
run: docker ps
- name: Run Playwright tests
run: pnpm playwright test
- name: Archive Playwright report
if: failure()
uses: actions/upload-artifact@v6
with:
name: playwright-report
path: |
tests/e2e/playwright-report
tests/e2e/test-results
retention-days: 5
- name: Dump server logs
if: failure()
run: docker logs mealie-e2e
- name: Destroy Test Environment
if: always()
run: docker compose down --volumes
working-directory: ./tests/e2e/docker