-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (81 loc) · 2.01 KB
/
pr-backend-ci.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Backend Pull Request Check
env:
HUSKY: 0
# environment variables for testing
JWT_SECRET: "test_secret"
JWT_REFRESH_SECRET: "test_refresh"
JWT_EXPIRATION_TIME: "15min"
CORS_ORIGIN: ""
EMAIL_ADAPTER: "mailhog"
DATABASE_URL: ""
REDIS_URL: ""
SMTP_HOST: ""
SMTP_PORT: "1025"
SMTP_USER: ""
SMTP_PASSWORD: ""
AWS_REGION: "us-east-1"
AWS_ACCESS_KEY_ID: ""
AWS_SECRET_ACCESS_KEY: ""
AWS_BUCKET_NAME: ""
SES_EMAIL: "[email protected]"
STRIPE_SECRET_KEY: "test_secret"
STRIPE_PUBLISHABLE_KEY: "test_secret"
STRIPE_WEBHOOK_SECRET: "test_secret"
on:
pull_request:
branches:
- "*"
paths:
- apps/api/**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20.15.0
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Run ESLint
run: pnpm --filter=api lint-tsc
build:
name: Build app
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./apps/api/
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20.15.0
cache: pnpm
- run: pnpm install
- name: Build the app
run: pnpm run build
test:
name: Jest tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Start containers
run: docker compose -f "docker-compose.yml" up -d --build
- uses: actions/setup-node@v4
with:
node-version: 20.9.0
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Run unit tests
run: pnpm --filter=api test:ci
- name: Run e2e tests
run: pnpm --filter=api test:e2e