-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (48 loc) · 1.32 KB
/
test.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
49
50
name: Lint, test & build
on:
push:
branches:
- dev
- main
pull_request:
env:
BASE_BRANCH: dev
POSTGRES_PASSWORD: postgres
ADMIN_EMAIL: [email protected]
ADMIN_PASSWORD: admin
DUMMY_EDITOR_EMAIL: [email protected]
DUMMY_EDITOR_PASSWORD: editor
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: nrwl/nx-set-shas@v3
with:
main-branch-name: $BASE_BRANCH
- run: npm ci --legacy-peer-deps
- run: npx nx format:check --base=$BASE_BRANCH
- run: npx nx affected --target=lint --parallel=3 --base=origin/$BASE_BRANCH
- run: npx nx affected --target=test --parallel=3 --ci --code-coverage --base=origin/$BASE_BRANCH
- run: |
npx nx serve backend &
npx wait-on http://localhost:3333/api
- run: npx nx e2e backend-e2e
- run: npx nx affected --target=build --parallel=3 --base=origin/$BASE_BRANCH