-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (83 loc) · 2.3 KB
/
github-actions.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
name: Node.js CI
on: [push]
jobs:
prettier:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Server install
run: npm ci
- name: Prettify code
uses: creyD/[email protected]
with:
prettier_options: --write **/*.{tsx,ts,jsx,js,md}
only_changed: True
build_test:
needs: prettier
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
services:
postgres:
image: postgis/postgis
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: maestro
ports:
- 5432:5432
options:
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
s3:
image: adobe/s3mock:3.5.2
ports:
- 9090:9090
env:
initialBuckets: "maestro"
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Server install
run: npm ci
- name: build
run: npm run build
env:
AUTH_SECRET: abcd1234
DATABASE_URL: postgres://postgres:postgres@localhost:5432/maestro
NODE_ENV: production
S3_ENDPOINT: s3
S3_REGION: region
S3_ACCESS_KEY_ID: key
S3_SECRET_ACCESS_KEY: secret
- name: Frontend linter
run: npm --prefix frontend run lint
- name: Server linter
run: npm run lint
- name: Frontend tests
run: npm --prefix frontend test -- --test-timeout=30000
# - name: Migration tests
# run: npm run test:database
# env:
# AUTH_SECRET: abcd1234
# DATABASE_URL: postgres://postgres:postgres@localhost:5432/maestro
- name: Server tests
run: npm run test
env:
AUTH_SECRET: abcd1234
DATABASE_URL: postgres://postgres:postgres@localhost:5432/maestro