Skip to content

CI

CI #115

Workflow file for this run

name: CI
on:
pull_request:
branches: ['main']
workflow_dispatch:
jobs:
lint-and-test:
runs-on: ubuntu-latest
container: node:lts-jod
services:
mongo:
image: mongo:7
ports:
- 27017:27017
options: >-
--health-cmd "echo \"try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'localhost:27017'}]}) }\" | mongosh --port 27017 --quiet"
--health-interval 5s
--health-retries 30
--health-start-interval 1s
--health-start-period 0s
--health-timeout 30s
--name mongo
steps:
- name: Checkout Code
uses: actions/checkout@v5
- name: Setup PNPM
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v6
with:
cache: 'pnpm'
node-version-file: '.nvmrc'
- name: Generate Environment
run: |
./scripts/generate-env.sh
sed -i 's/^MONGO_URI=.*/MONGO_URI=mongodb:\/\/mongo:27017/' .env
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Install Playwright
run: pnpm --filter "@opendatacapture/e2e" exec playwright install --with-deps
- name: Lint
run: pnpm lint
- name: Unit Tests
run: pnpm test
- name: End-to-End Tests
run: pnpm --filter "@opendatacapture/e2e" test