-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (62 loc) · 2.18 KB
/
development.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
name: Development workflow
on:
push:
branches-ignore:
- 'main'
pull_request:
branches: 'beta'
workflow_dispatch:
workflow_call:
jobs:
lint:
name: Lint codebase
if: ${{ !contains(github.event.head_commit.message, 'skip ci') }}
runs-on: ubuntu-latest
steps:
- name: '☁️ checkout repository'
uses: actions/checkout@v4
- name: '🔧 Setup Node.js'
uses: actions/setup-node@v4
with:
node-version: '20'
- name: '📦 install dependencies'
run: npm ci
- name: '✅ run ESLint'
run: npm run lint:eslint
- name: '✅ run Prettier'
run: npm run lint:prettier
build-project:
name: Build and test project
needs: lint
if: ${{ !contains(github.event.head_commit.message, 'skip ci') }}
runs-on: ubuntu-latest
env:
PG_USER: postgres
PG_PW: supersecret
PG_DB: community-service-test
DATABASE_URL: postgres://postgres:supersecret@localhost:5432/community-service-test?schema=public
services:
postgres:
image: postgres:14.2
env:
POSTGRES_USER: ${ PG_USER }
POSTGRES_PASSWORD: ${ PG_PW }
POSTGRES_DB: ${ PG_DB }
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: '📄 Log Database URL'
run: echo "Database URL $DATABASE_URL; PG_USER $PG_USER; PG_PW $PG_PW; PG_DB $PG_DB"
- name: '☁️ checkout repository'
uses: actions/checkout@v4
- name: '🔧 Setup Node.js'
uses: actions/setup-node@v4
with:
node-version: '20'
- name: '📦 install dependencies'
run: npm ci
- name: '📂 build'
run: npm run build
# - name: '✅ run API tests'
# run: npm run test:api