-
Notifications
You must be signed in to change notification settings - Fork 1.1k
236 lines (201 loc) · 7.06 KB
/
ci.yml
File metadata and controls
236 lines (201 loc) · 7.06 KB
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
name: Continuous Integration
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions:
contents: read
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTFLAGS: "-C link-arg=-fuse-ld=lld -D warnings"
THEGRAPH_STORE_POSTGRES_DIESEL_URL: "postgresql://graph:graph@localhost:5432/graph-test"
jobs:
unit-tests:
name: Run unit tests
runs-on: nscloud-ubuntu-22.04-amd64-16x32
timeout-minutes: 20
services:
ipfs:
image: ipfs/go-ipfs:v0.10.0
ports:
- 5001:5001
postgres:
image: bitnami/postgresql
env:
POSTGRESQL_PASSWORD: graph
POSTGRESQL_USERNAME: graph
POSTGRESQL_DB: graph-test
POSTGRESQL_INITDB_ARGS: "-E UTF8 --locale=C"
POSTGRESQL_MAX_CONNECTIONS: 500
POSTGRESQL_REPLICATION_USE_PASSFILE: no
options: >-
--health-cmd "pg_isready -U graph"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Setup dependencies
run: |
sudo apt-get update
sudo apt-get install -y lld protobuf-compiler
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 # v1
- name: Setup just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
- name: Install cargo-nextest
uses: baptiste0928/cargo-install@e38323ef017552d7f7af73a3f4db467f278310ed # v3
with:
crate: cargo-nextest
version: ^0.9
- name: Run unit tests
run: just test-unit --verbose
runner-tests:
name: Subgraph Runner integration tests
runs-on: nscloud-ubuntu-22.04-amd64-16x32
timeout-minutes: 20
services:
ipfs:
image: ipfs/go-ipfs:v0.10.0
ports:
- 5001:5001
postgres:
image: bitnami/postgresql
env:
POSTGRESQL_PASSWORD: graph
POSTGRESQL_USERNAME: graph
POSTGRESQL_DB: graph-test
POSTGRESQL_INITDB_ARGS: "-E UTF8 --locale=C"
POSTGRESQL_MAX_CONNECTIONS: 500
POSTGRESQL_REPLICATION_USE_PASSFILE: no
options: >-
--health-cmd "pg_isready -U graph"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Setup dependencies
run: |
sudo apt-get update
sudo apt-get install -y lld protobuf-compiler
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 # v1
- name: Setup just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
- name: Install cargo-nextest
uses: baptiste0928/cargo-install@e38323ef017552d7f7af73a3f4db467f278310ed # v3
with:
crate: cargo-nextest
version: ^0.9
- name: Install pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
- name: Install Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 20
cache: pnpm
- name: Install Node.js dependencies
run: pnpm install
- name: Run runner tests
run: just test-runner --verbose
integration-tests:
name: Run integration tests
runs-on: nscloud-ubuntu-22.04-amd64-16x32
timeout-minutes: 20
services:
ipfs:
image: ipfs/go-ipfs:v0.10.0
ports:
- 3001:5001
postgres:
image: bitnami/postgresql
env:
POSTGRESQL_PASSWORD: let-me-in
POSTGRESQL_USERNAME: graph-node
POSTGRESQL_DB: graph-node
POSTGRESQL_INITDB_ARGS: "-E UTF8 --locale=C"
POSTGRESQL_MAX_CONNECTIONS: 500
POSTGRESQL_REPLICATION_USE_PASSFILE: no
options: >-
--health-cmd "pg_isready -U graph-node"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 3011:5432
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Setup dependencies
run: |
sudo apt-get update
sudo apt-get install -y lld protobuf-compiler
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 # v1
- name: Setup just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
- name: Install cargo-nextest
uses: baptiste0928/cargo-install@e38323ef017552d7f7af73a3f4db467f278310ed # v3
with:
crate: cargo-nextest
version: ^0.9
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1
with:
# Pinned to specific version since newer versions do not produce
# deterministic block hashes. Unpin once that's fixed upstream
version: v1.2.3
- name: Install pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
- name: Install Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 20
cache: pnpm
- name: Install Node.js dependencies
run: pnpm install
- name: Start anvil
run: anvil --gas-limit 100000000000 --base-fee 1 --block-time 2 --timestamp 1743944919 --port 3021 &
- name: Build graph-node
run: just build --test integration_tests
- name: Run integration tests
run: just test-integration --verbose
- name: Cat graph-node.log
if: always()
run: cat tests/integration-tests/graph-node.log || echo "No graph-node.log"
rustfmt:
name: Check rustfmt style
runs-on: ubuntu-latest
timeout-minutes: 10
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 # v1
- name: Setup just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
- name: Check formatting
run: just format --check
release-check:
name: Build in release mode
runs-on: ubuntu-latest
timeout-minutes: 60
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Setup dependencies
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 # v1
- name: Setup just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
- name: Cargo check (release)
run: just check --release