Skip to content

feat: move script to workflow #5

feat: move script to workflow

feat: move script to workflow #5

Workflow file for this run

name: E2E
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
jobs:
build:
name: Run e2e tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install dependencies
run: |
corepack enable
pnpm install
- name: Build docker compose
run: |
current_branch=$(git rev-parse --abbrev-ref HEAD)
git clone -b $current_branch https://github.com/jsdelivr/globalping-dash-directus.git test/e2e/globalping-dash-directus || git clone https://github.com/jsdelivr/globalping-dash-directus.git test/e2e/globalping-dash-directus
cd test/e2e/globalping-dash-directus
pnpm i
pnpm exec playwright install --with-deps chromium
cp .env.e2e.example .env.e2e
cp .env.example .env
perl -pi -e 's/DASH_INDEX_FILE_PATH=.*/DASH_INDEX_FILE_PATH=..\/..\/..\/.output\/server\/index.mjs/' .env
docker compose -f docker-compose.e2e.yml up --build -d
pnpm run init:e2e
docker compose -f docker-compose.e2e.yml stop
cd ../../../
- name: Build dashboard repo
run: |
pnpm run test:e2e:build:dash
- name: Run tests
run: |
pnpm run test:e2e:run