-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (109 loc) · 2.8 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 --parallel
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
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"
- run: rm foundry.toml # force hardhat https://github.com/foundry-rs/foundry/issues/3827
- uses: crytic/slither-action@v0.2.0
with:
fail-on: high
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/github-action@1.1.3
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 coverage