-
Notifications
You must be signed in to change notification settings - Fork 75
68 lines (52 loc) · 1.55 KB
/
subgraph.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
name: Subgraph Tests
on:
pull_request:
branches: [main, release/**]
push:
branches: [main, release/**]
tags: [v*]
concurrency:
group: pr-checks-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
subgraph-workflow:
runs-on: ubuntu-latest
permissions:
contents: write
defaults:
run:
working-directory: ./tools/subgraph-example/
steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18.15
- name: Checkout repo
uses: actions/checkout@v3
- name: Install dependencies
run: npm ci
- name: Create .env file
run: cp .env.example .env
- name: Run local node
run: npx hedera start -d
timeout-minutes: 5
- name: Compile contracts
run: npx hardhat compile
- name: Deploy and interact with contracts
run: npx hardhat prepare
- name: Generate types
run: npm run graph-codegen
- name: Start local graph-node
run: npm run graph-local -- --detach
- name: Sleep for 20 seconds
run: sleep 20s
shell: bash
- name: Create subgraph
run: npm run create-local
- name: Deploy subgraph
run: npm run deploy-local -- --network local --version-label 0.0.1
- name: Sleep for 10 seconds (allow time to index past events following new sub-graph deployment)
run: sleep 10s
shell: bash
- name: Run the tests
run: npx hardhat test