Skip to content

E2E tests

E2E tests #148

Workflow file for this run

name: E2E tests
on:
workflow_run:
workflows:
- "Build current image"
branches: [main]
types:
- completed
jobs:
test:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version-file: './e2e/.nvmrc'
- name: Install pnpm
id: pnpm-install
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Pull images
run: docker-compose --file './docker-compose.e2e.yaml' pull
- name: Start compose
run: docker-compose --file './docker-compose.e2e.yaml' up -d
- name: Install E2E dependencies
working-directory: ./e2e
run: pnpm install --frozen-lockfile
- name: Install playwright chromium
working-directory: ./e2e
run: npx playwright install --with-deps chromium
- name: run tests
working-directory: ./e2e
run: pnpm test
- name: Stop compose
if: always()
run: docker-compose --file './docker-compose.e2e.yaml' down
- uses: actions/upload-artifact@v3
if: failure()
with:
name: playwright-report
path: |
./e2e/playwright-report
retention-days: 7