Skip to content

[1647] add config for running e2e in ci #2543

[1647] add config for running e2e in ci

[1647] add config for running e2e in ci #2543

Workflow file for this run

name: Repo Checks
on: ["push", "pull_request"]
jobs:
check_code_quality:
name: Code Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup-repo
- name: Linting
if: always()
run: yarn lint
- name: Formatting
if: always()
run: yarn check-formatting
# TODO: Add unit tests
# - name: Unit Tests
# if: always()
# run: yarn test
- name: Types
if: always()
run: yarn check-types
integration_tests:
name: Integration Tests
runs-on: ubuntu-latest
needs: check_code_quality
services:
typesense:
image: typesense/typesense:0.24.0
ports:
- 8108:8108
env:
TYPESENSE_DATA_DIR: /app/data
TYPESENSE_API_KEY: test-api-key
TYPESENSE_ENABLE_CORS: "true"
volumes:
- typesense-data:/app/data
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup-repo
- name: Cache Emulators
uses: actions/cache@v2
with:
path: /home/runner/.cache/firebase/emulators
key: ${{ runner.os }}-firebase-emulators-${{ hashFiles('~/.cache/firebase/emulators/**') }}
- name: Run Integration Tests
run: >
yarn test:integration-ci
tests/integration/testimony.test.ts
tests/integration/auth.test.ts
tests/integration/moderation.test.ts
tests/integration/profile.test.ts
e2e_tests:
name: E2E Tests
runs-on: ubuntu-latest
needs: check_code_quality
environment: dev
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-repo
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: |
node_modules
key: modules-${{ hashFiles('package-lock.json') }}
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
- name: Run Playwright tests
run: yarn test:e2e:headless
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30