Merge branch 'ui-dataset-citations' of https://github.com/pathoplexus… #1632
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: e2e | |
on: | |
push: | |
concurrency: | |
group: ci-${{ github.ref }}-e2e | |
cancel-in-progress: true | |
jobs: | |
E2ETests: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: read | |
contents: read | |
checks: read | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Cache .npm | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('website/**/package-lock.json') }} | |
- name: Install dependencies | |
run: cd website && npm i | |
- name: Get Installed Playwright Version | |
id: playwright-version | |
run: cd website && echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').packages['node_modules/@playwright/test'].version)")" >> $GITHUB_ENV | |
- name: Cache Playwright Browsers | |
uses: actions/cache@v3 | |
id: playwright-cache | |
with: | |
path: ~/.cache/ms-playwright | |
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} | |
- name: Install Playwright Browsers and System Dependencies | |
run: cd website && npx playwright install --with-deps | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
- name: Install only System Dependencies | |
run: cd website && npx playwright install-deps | |
if: steps.playwright-cache.outputs.cache-hit == 'true' | |
- name: Wait for Backend Docker Image | |
uses: lewagon/[email protected] | |
with: | |
ref: ${{ github.ref }} | |
check-name: Build Backend Docker Image | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Wait for Website Docker Image | |
uses: lewagon/[email protected] | |
with: | |
ref: ${{ github.ref }} | |
check-name: Build Website Docker Image | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker metadata | |
id: dockerMetadata | |
uses: docker/metadata-action@v5 | |
with: | |
images: doesNotMatter | |
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 "dockerTag=${TAG##*:}" >> $GITHUB_OUTPUT | |
- name: Start Docker Containers | |
run: | | |
mkdir ./log | |
chmod -R 777 ./log | |
docker compose up -d | |
env: | |
WEBSITE_IMAGE: ghcr.io/pathoplexus/website:${{ steps.branchTag.outputs.dockerTag }} | |
BACKEND_IMAGE: ghcr.io/pathoplexus/backend:${{ steps.branchTag.outputs.dockerTag }} | |
- name: Wait for Health Checks | |
run: ./.github/scripts/wait_for_backend.sh && ./.github/scripts/wait_for_frontend.sh | |
- name: Run Playwright tests | |
run: cd website && npm run e2e | |
- uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: playwright-report | |
path: website/playwright-report/ | |
retention-days: 30 | |
- uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: log | |
path: log/ | |
retention-days: 30 | |
- name: Log debugging info | |
if: ${{ failure() }} | |
run: docker logs pathoplexus-backend-1 && docker logs pathoplexus-website-1 |