-
Notifications
You must be signed in to change notification settings - Fork 59
48 lines (38 loc) · 1.13 KB
/
backend-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Run Backend Tests
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-22.04
services:
postgres:
image: postgres:latest
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
check-latest: true
cache: 'yarn'
- name: Remove frontend code to ensure the proper dependencies are declared in the backend package.json
run: rm -rf apps/frontend
- name: Install project dependencies
run: yarn backend install --frozen-lockfile
- name: Copy .env-ci to .env
run: cp apps/backend/test/.env-ci apps/backend/.env
- name: Create/migrate db
run: |
yarn backend sequelize-cli db:create
yarn backend sequelize-cli db:migrate
- name: Run unit tests
run: yarn backend test:ci-cov
- name: Ensure the app builds cleanly without frontend dependencies
run: yarn backend build