-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (95 loc) · 2.77 KB
/
ci.yml
File metadata and controls
108 lines (95 loc) · 2.77 KB
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
100
101
102
103
104
105
106
107
108
name: CI
on:
pull_request:
push:
branches:
- main
jobs:
api:
name: API build and tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: underflow_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d underflow_test"
--health-interval 10s
--health-timeout 5s
--health-retries 5
defaults:
run:
working-directory: apps/api
env:
DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/underflow_test
TEST_DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/underflow_test
CSRF_SECRET: ci-csrf-secret
JWT_ACCESS_SECRET: ci-access-secret
JWT_REFRESH_SECRET: ci-refresh-secret
CLIENT_URL: http://localhost:5174
AWS_REGION: us-west-2
AWS_SES_REGION: us-west-2
EMAIL_PROVIDER: console
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: apps/api/package-lock.json
- run: npm ci
- run: npm run build
- run: npm test
- run: npm run test:db
web:
name: Web build and tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/web
env:
VITE_API_URL: /api/v1
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: apps/web/package-lock.json
- run: npm ci
- run: npm test
- run: npm run build
api-docker:
name: API Docker build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: docker build -f apps/api/Dockerfile apps/api
terraform:
name: Terraform fmt and validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: apps/api/package-lock.json
- name: Build scheduled sync Lambda artifact
working-directory: apps/api
run: |
npm ci
npm run build:lambda
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.8.5
- run: terraform -chdir=infra/terraform fmt -check -recursive
- run: terraform -chdir=infra/terraform/envs/bootstrap-cicd init -backend=false
- run: terraform -chdir=infra/terraform/envs/bootstrap-cicd validate
- run: terraform -chdir=infra/terraform/envs/production init -backend=false
- run: terraform -chdir=infra/terraform/envs/production validate