Skip to content

Fix-e2e-tests (#35) #214

Fix-e2e-tests (#35)

Fix-e2e-tests (#35) #214

Workflow file for this run

name: Checks and Tests
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Install dependencies
run: pnpm install
- name: Build
working-directory: packages/dataqueue
run: pnpm run build
- name: Run check format
run: pnpm run check-format
- name: Run check exports
working-directory: packages/dataqueue
run: pnpm run check-exports
- name: Run lint
working-directory: packages/dataqueue
run: pnpm run lint
- name: Run test coverage
working-directory: packages/dataqueue
run: pnpm run test:coverage
timeout-minutes: 3
- name: Upload unit coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: packages/dataqueue/coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
flags: unit
name: unit-coverage
fail_ci_if_error: false
e2e:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Install dependencies
run: pnpm install
- name: Build dataqueue
working-directory: packages/dataqueue
run: pnpm run build
- name: Build react
working-directory: packages/react
run: pnpm run build
- name: Create E2E test database and run migrations
run: |
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "CREATE DATABASE e2e_test;"
PG_DATAQUEUE_DATABASE=postgres://postgres:postgres@localhost:5432/e2e_test pnpm run migrate-dataqueue
working-directory: apps/e2e
- name: Install Playwright browsers
working-directory: apps/e2e
run: npx playwright install --with-deps chromium
- name: Build e2e
working-directory: apps/e2e
run: pnpm run build
- name: Run E2E coverage
working-directory: apps/e2e
run: pnpm run test:e2e:coverage
timeout-minutes: 5
env:
PG_DATAQUEUE_DATABASE: postgres://postgres:postgres@localhost:5432/e2e_test
- name: Upload e2e coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: apps/e2e/coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
flags: e2e
name: e2e-coverage
fail_ci_if_error: false
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: apps/e2e/playwright-report/
retention-days: 7