forked from openmobilityfoundation/mds-core
-
Notifications
You must be signed in to change notification settings - Fork 9
101 lines (95 loc) · 2.42 KB
/
pr-checker.yaml
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
name: MDS-Core Continuous Integration
on:
pull_request:
branches:
- develop
workflow_dispatch:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "16.14.2"
- uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- uses: pnpm/action-setup@v2.1.0
with:
version: 6.31.0
- name: Install Dependencies
run: |
pnpm i
- name: Run Linters
run: |
pnpm lint
- name: Run Build
run: |
pnpm build
tests:
runs-on: ubuntu-latest
container: node:16
services:
postgres:
image: postgis/postgis:13-master
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: "16.14.2"
- uses: pnpm/action-setup@v2.1.0
with:
version: 6.31.0
- uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install Dependencies
run: |
pnpm i
- name: Install PostgreSQL client & net-tools
run: |
apt-get update
apt-get install --yes postgresql-client
apt-get install --yes net-tools
- name: Create Postgres DB
env:
PGPASSWORD: postgres
run: |
createdb -h postgres -U postgres mdstest
- name: Run Tests
env:
PG_NAME: mdstest
PG_USER: postgres
PG_HOST: postgres
PG_PASS: postgres
REDIS_HOST: redis
NODE_OPTIONS: "--max_old_space_size=4096"
run: |
pnpm test -- --filter "...[origin/develop]"