-
Notifications
You must be signed in to change notification settings - Fork 8
120 lines (93 loc) · 2.82 KB
/
ci.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: CI
on: [push, workflow_dispatch]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 20.x
- name: Install dependencies
run: npm ci
- name: Run eslint
run: npm run lint
test:
name: Unit Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: --health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 20.x
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Set up Postgres
run: node scripts/setupPostgresTestEnv.cjs
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
- name: Run @canvas-js/gossiplog tests
run: npm run test --workspace=@canvas-js/gossiplog
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
- name: Run @canvas-js/modeldb tests
run: npm run test --workspace=@canvas-js/modeldb
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
- name: Run @canvas-js/chain-atp tests
run: npm run test --workspace=@canvas-js/chain-atp
- name: Run @canvas-js/core tests
run: npm run test --workspace=@canvas-js/core
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
- name: Run @canvas-js/vm tests
run: npm run test --workspace=@canvas-js/vm
- name: Run @canvas-js/interfaces interface tests
run: npm run test --workspace=@canvas-js/interfaces
# - name: Run @canvas-js/ethereum-contracts tests
# run: npm run test --workspace=@canvas-js/ethereum-contracts
- name: Run @canvas-js/chain-ethereum tests
run: npm run test --workspace=@canvas-js/chain-ethereum
- name: Run @canvas-js/signatures tests
run: npm run test --workspace=@canvas-js/signatures
test-build:
name: Missing dependencies between subpackages (pnpm)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 20.x
- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 9
- name: Install modules
run: pnpm i
- name: Build
run: pnpm run build