Skip to content

test(website): make lineage-filter selection resilient to menu re-ren… #2876

test(website): make lineage-filter selection resilient to menu re-ren…

test(website): make lineage-filter selection resilient to menu re-ren… #2876

Workflow file for this run

name: End-to-end Tests
on: [push]
jobs:
tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./website
steps:
- uses: actions/checkout@v7.0.0
- uses: actions/setup-node@v6.4.0
with:
node-version: lts/*
- name: Cache .npm
uses: actions/cache@v6
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('lapis-e2e/**/package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Docker metadata
id: dockerMetadata
uses: docker/metadata-action@v6.2.0
with:
images: "dummyImageName"
tags: |
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/main' }}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
- name: Get Branch Tag
id: branchTag
env:
TAG: ${{ steps.dockerMetadata.outputs.tags }}
run: echo "branchTag=${TAG##*:}" >> $GITHUB_OUTPUT
- name: Wait for website Docker image
uses: lewagon/wait-on-check-action@v1.8.1
with:
ref: ${{ github.sha }}
check-name: Build Website Docker Image
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
- name: Wait for backend Docker image
uses: lewagon/wait-on-check-action@v1.8.1
with:
ref: ${{ github.sha }}
check-name: Build Backend Docker Image
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 5
- name: Start Docker Containers
run: docker compose -f ../docker-compose.yml up -d --wait
env:
WEBSITE_TAG: ${{ steps.branchTag.outputs.branchTag }}
BACKEND_TAG: ${{ steps.branchTag.outputs.branchTag }}
SEEDER_TAG: ${{ steps.branchTag.outputs.branchTag }}
- name: Run Playwright tests (all browsers)
if: github.ref == 'refs/heads/main'
run: npm run e2e
env:
BACKEND_URL: http://localhost:9021
- name: Run Playwright tests (chromium only)
if: github.ref != 'refs/heads/main'
run: npm run e2e:chromium
env:
BACKEND_URL: http://localhost:9021
- name: Collect container logs
if: ${{ always() && !cancelled() }}
run: |
mkdir -p /tmp/container-logs
services="$(docker compose -f ../docker-compose.yml config --services || true)"
for service in $services; do
docker compose -f ../docker-compose.yml logs --no-color "$service" > "/tmp/container-logs/${service}.log" || true
done
- name: Upload container logs
uses: actions/upload-artifact@v7
if: ${{ always() && !cancelled() }}
with:
name: container-logs
path: /tmp/container-logs/
retention-days: 7
- name: Upload Playwright report
uses: actions/upload-artifact@v7
if: ${{ !cancelled() }}
with:
name: playwright-report
path: website/playwright-report/
retention-days: 30