feat: add public probes checkbox #42
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: | |
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: Clone globalping-dash-directus | |
env: | |
CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }} | |
run: | | |
echo "Current branch: $CURRENT_BRANCH." | |
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 | |
- name: Install globalping-dash-directus dependencies | |
working-directory: ./test/e2e/globalping-dash-directus | |
run: | | |
pnpm i | |
pnpm exec playwright install --with-deps chromium | |
- name: Prepare .env files | |
working-directory: ./test/e2e/globalping-dash-directus | |
run: | | |
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 | |
- name: Build globalping-dash-directus | |
working-directory: ./test/e2e/globalping-dash-directus | |
run: | | |
docker compose -f docker-compose.e2e.yml up --build -d | |
pnpm run init:e2e | |
docker compose -f docker-compose.e2e.yml stop | |
- name: Build globalping-dash | |
run: | | |
npx dotenv -e test/e2e/globalping-dash-directus/.env -- pnpm build | |
- name: Run tests | |
working-directory: ./test/e2e/globalping-dash-directus | |
run: | | |
pnpm run test:e2e:run |