-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (49 loc) · 1.32 KB
/
api-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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: API Tests
on:
push:
paths:
- 'api/**'
- 'shared/**'
- '.github/workflows/api-tests.yml'
- '/*' # include changes in root
- '!client/**' # exclude client folder
- '!infrastructure/**' # exclude infra folder
- 'package.json'
workflow_dispatch:
jobs:
api-tests-integration:
name: API Integration Tests
runs-on: ubuntu-22.04
services:
database:
image: postgres:13
ports:
- 5432:5432
env:
POSTGRES_USER: 4growth
POSTGRES_PASSWORD: 4growth
POSTGRES_DB: 4growth
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Node setup
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- uses: pnpm/action-setup@v4
- name: Cache dependencies
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: Install dependencies
working-directory: .
run: pnpm install
- name: Lint code
working-directory: api
run: pnpm lint
- name: Run API tests
working-directory: api
run: pnpm test