-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (70 loc) · 2.38 KB
/
ci.yaml
File metadata and controls
85 lines (70 loc) · 2.38 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
name: 'Continuous Integration'
on:
push:
branches:
- main
pull_request:
jobs:
ci:
name: 'Continuous Integration'
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: fmicodes
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install dependencies
run: pnpm install
- name: Get environment files
run: |
curl -H "Authorization: token ${TOKEN}" https://raw.githubusercontent.com/fss-fmi/secrets/main/fmicodes/.env.development > .env
curl -H "Authorization: token ${TOKEN}" https://raw.githubusercontent.com/fss-fmi/secrets/main/fmicodes/apps/fmicodes-api/.env.development > ./apps/fmicodes-api/.env
curl -H "Authorization: token ${TOKEN}" https://raw.githubusercontent.com/fss-fmi/secrets/main/fmicodes/apps/fmicodes-site/.env.development > ./apps/fmicodes-api/.env
curl -H "Authorization: token ${TOKEN}" https://raw.githubusercontent.com/fss-fmi/secrets/main/fmicodes/apps/fmicodes-admin/.env.development > ./apps/fmicodes-admin/.env
env:
TOKEN: ${{ secrets.FSS_FMI_GITHUB_TOKEN }}
- name: Build
run: pnpm nx run-many -t build --parallel
- name: Check formatting
run: pnpm prettier . --check
- name: Check linting
run: pnpm nx run-many -t lint --parallel
- name: Test
run: pnpm nx run-many -t test --parallel --configuration=ci
- name: E2E
run: |
pnpm prisma migrate dev
pnpm nx run-many -t e2e --parallel=false