Run prettier #668
Workflow file for this run
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: Run test suites | |
on: | |
push: | |
branches: main | |
pull_request: | |
jobs: | |
wait-for-vercel: | |
name: Wait for vercel | |
runs-on: ubuntu-latest | |
steps: | |
- name: Wait for Vercel preview deployment to be ready | |
uses: patrickedqvist/[email protected] | |
id: wait | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
max_timeout: 240 | |
outputs: | |
preview_url: ${{ steps.wait.outputs.url }} | |
generate-test-run-id: | |
name: Generate Test Run ID | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set UUID | |
id: generate-uuid | |
uses: filipstefansson/uuid-action@v1 | |
- name: Get the UUID | |
run: echo "UUID is ${{ steps.generate-uuid.outputs.uuid }}" | |
outputs: | |
testRunId: ${{ steps.generate-uuid.outputs.uuid }} | |
e2e-test: | |
name: Playwright e2e tests | |
needs: [generate-test-run-id, wait-for-vercel] | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
# Install (and cache) PNPM dependencies | |
- uses: pnpm/action-setup@v3 | |
name: Install pnpm | |
with: | |
version: 8 | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Get Replay Chromium | |
run: npx replayio install | |
- name: Run Playwright tests | |
run: pnpm test:e2e:record | |
env: | |
APP_URL: ${{ needs.wait-for-vercel.outputs.preview_url }} | |
AUTH0_BASE_URL: ${{ needs.wait-for-vercel.outputs.preview_url }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
RECORD_REPLAY_METADATA_TEST_RUN_TITLE: E2E Tests | |
RECORD_REPLAY_TEST_RUN_ID: ${{ needs.generate-test-run-id.outputs.testRunId }} | |
REPLAY_API_KEY: ${{ secrets.REPLAY_API_KEY }} | |
TEST_USER_API_KEY: ${{ secrets.TEST_USER_API_KEY }} | |
TEST_USER_3_PASSWORD: ${{ secrets.TEST_USER_3_PASSWORD }} | |
AUTH0_ISSUER_BASE_URL: https://webreplay.us.auth0.com | |
AUTH0_CLIENT_ID: 4FvFnJJW4XlnUyrXQF8zOLw6vNAH1MAo | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |
unit-test: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "16" | |
# Install (and cache) PNPM dependencies | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- uses: pnpm/action-setup@v3 | |
name: Install pnpm | |
with: | |
version: 8 | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Run tests | |
run: pnpm test |