Split Seed and Integration Tests, Various Prisma Fixes #2761
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: Master Barrier | |
on: | |
pull_request: | |
branches: [ master ] | |
jobs: | |
integration: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
node-version: [18.x] | |
services: | |
postgres-integration: | |
image: postgres:10.8 | |
env: | |
POSTGRES_USER: test | |
POSTGRES_PASSWORD: test | |
POSTGRES_DB: integration | |
ports: | |
- 5001:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache dependencies | |
id: cache | |
uses: actions/cache@v2 | |
with: | |
path: ./node_modules | |
key: modules-${{ hashFiles('package-lock.json') }} | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Install Prisma | |
run: npx prisma generate | |
- name: Build Backend | |
run: npm run build --if-present | |
- name: Run Unit Tests | |
run: npm test | |
- name: Setup Dev DB with Prisma Schema | |
run: npm run db:reset -- --skip-generate | |
env: | |
DATABASE_URL: "postgres://test:test@localhost:5001/integration" | |
- name: Run Integration Tests | |
run: npm run integration-tests | |
env: | |
DATABASE_URL: "postgres://test:test@localhost:5001/integration" | |
lint: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- name: Cache dependencies | |
id: cache | |
uses: actions/cache@v2 | |
with: | |
path: ./node_modules | |
key: modules-${{ hashFiles('package-lock.json') }} | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Install Prisma | |
run: npx prisma generate | |
- run: npm run linter |