Skip to content

Run Tests

Run Tests #111

Workflow file for this run

name: Run Tests
on:
workflow_run:
workflows: ["Deploy to Staging"]
types:
- completed
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Run lint
run: bun run lint:ci
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Run unit tests
run: bun run test
e2e-tests:
runs-on: ubuntu-latest
steps:
- name: Download deploy URL
id: download-artifact
uses: dawidd6/action-download-artifact@v3
with:
workflow: "deploy_staging.yml"
workflow_conclusion: "success"
name: "deploy-url"
- name: Set deploy URL
id: url
run: echo "DEPLOY_URL=$(cat deploy-url.txt)" >> $GITHUB_ENV
- name: Debug deploy URL
run: 'echo "DEPLOY_URL: ${{ env.DEPLOY_URL }}"'
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Install Playwright Browsers
run: bunx playwright install --with-deps
- name: Run Playwright tests
run: bunx playwright test
env:
VITE_AUTH0_TEST_USERNAME: ${{ secrets.VITE_AUTH0_TEST_USERNAME }}
VITE_AUTH0_TEST_PASSWORD: ${{ secrets.VITE_AUTH0_TEST_PASSWORD }}
PLAYWRIGHT_TEST_BASE_URL: ${{ env.DEPLOY_URL }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30