-
Notifications
You must be signed in to change notification settings - Fork 12
156 lines (133 loc) · 3.78 KB
/
pull-request-develop.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# This workflow runs lint/test/build in parallel
# on every pull request to develop
# It also produces test coverage comments
name: "Validate PRs to develop"
on:
# run on every pull request
pull_request:
# only for the following branches
branches:
- develop
jobs:
# Installs npm dependencies for the first time,
# caching them in ~/.npm
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
# This only caches ~/.npm, therefore each subsequent
# job needs to run `npm ci` to install deps from npm cache
# alternative is to cache `node_modules` directly
# TODO:
# https://www.voorhoede.nl/en/blog/super-fast-npm-install-on-github-actions/
# Add caching of `node_modules` to speed up this workflow
cache: npm
# install dependencies from the package-lock.json
- name: Install dependencies
run: npm ci --workspaces
# builds all packages
build:
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- name: "Install dependencies"
run: npm ci --workspaces --include-workspace-root
- name: "Build"
run: npm run build
# lints all packages
lint:
runs-on: ubuntu-latest
needs: install
steps:
# check out the repository
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- name: "Install dependencies"
run: npm ci --workspaces --include-workspace-root
- name: "Build"
run: npm run build
- name: "Lint"
run: npm run lint
- name: "Check formatting"
run: npx prettier ./packages --check
# tests all packages
test:
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- name: "Install dependencies"
run: npm ci --workspaces --include-workspace-root
- name: "Build"
run: npm run build
- name: "Test"
run: npm run test:ci
integration:
runs-on: ubuntu-latest
needs: test
env:
POSTGRES_URL: localhost
REDIS_URL: localhost
REDIS_CI: true
DATABASE_URL: "postgresql://admin:password@localhost:5432/protokit?schema=public"
services:
postgres:
image: postgres:14-alpine
env:
POSTGRES_PASSWORD: password
POSTGRES_USER: admin
POSTGRES_DB: protokit
ports:
- 5432:5432
redis:
image: redis:6.2-alpine
ports:
- 6379:6379
lighnet:
image: o1labs/mina-local-network:compatible-latest-lightnet
env:
RUN_ARCHIVE_NODE: true
LOG_LEVEL: 'INFO'
PROOF_LEVEL: 'none'
NETWORK_TYPE: 'single-node'
ports:
- 3085:3085
- 8080:8080
- 8181:8181
# archive endpoints
- 8282:8282
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- name: "Install dependencies"
run: npm ci --workspaces --include-workspace-root
- name: "Build"
run: npm run build
- name: "Migrate DB"
run: npm run migrate
- name: "Wait for lightnet readiness"
uses: o1-labs/wait-for-mina-network-action@v1
with:
mina-graphql-port: 3085
max-attempts: 30
polling-interval-ms: 5000
- name: "Integration tests"
run: npm run test:integration