-
Notifications
You must be signed in to change notification settings - Fork 35
111 lines (109 loc) · 2.86 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
name: Solidity CI
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "npm"
- run: npm ci
- run: npx hardhat compile --show-stack-traces
- run: TS_NODE_TRANSPILE_ONLY=1 npx hardhat test
forge_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install Node modules
uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "npm"
- run: npm ci
- name: Run tests
run: FOUNDRY_PROFILE=intense forge test -vvv --no-match-contract=ValidatorStorage; forge test -vvv --match-contract=ValidatorStorage
gas_report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "npm"
- run: npm ci
- run: npm run test:gas
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "npm"
- run: npm ci
- run: npx solhint "contracts/**/*.sol"
- run: npx eslint .
- run: npx prettier -c .
slither:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "npm"
- uses: crytic/[email protected]
with:
node-version: 18
slither-args: "--compile-force-framework hardhat"
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "npm"
- run: npm ci
- run: npx hardhat compile
- name: solidity-coverage
run: npx hardhat coverage
- name: coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
forge_coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install Node modules
uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "npm"
- run: npm ci
- name: Print coverage
run: forge b; forge coverage