-
Notifications
You must be signed in to change notification settings - Fork 30
113 lines (96 loc) · 2.68 KB
/
test.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
name: test
on:
- workflow_dispatch
- push
env:
FOUNDRY_PROFILE: ci
FORK_RPC_URL_MAINNET: ${{ secrets.FORK_RPC_URL_MAINNET }}
FORK_RPC_URL_OPTIMISM: ${{ secrets.FORK_RPC_URL_OPTIMISM }}
FORK_RPC_URL_POLYGON: ${{ secrets.FORK_RPC_URL_POLYGON }}
jobs:
lint:
name: Foundry Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
id: init
- name: Run Forge fmt src
run: |
forge fmt --check ./src
id: fmt_src
if: ${{ steps.init.conclusion == 'success' }}
- name: Run Forge fmt test
run: |
forge fmt --check ./test
id: fmt_test
if: ${{ steps.init.conclusion == 'success' }}
- name: Run Forge fmt script
run: |
forge fmt --check ./script
id: fmt_deploy
if: ${{ steps.init.conclusion == 'success' }}
test:
name: Foundry Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/cache@v3
with:
path: "~/.foundry/cache/rpc"
key: "${{ runner.os }}-rpc-cache-v1"
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build
- name: Run Forge tests
run: |
forge test -vvv
id: test
coverage:
name: Foundry Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/cache@v3
with:
path: "~/.foundry/cache/rpc"
key: "${{ runner.os }}-rpc-cache-v1"
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build
- name: Run Forge coverage
run: |
forge coverage -vvv --report lcov --report summary
id: coverage
- name: Sanitize lcov report
run: |
sudo apt install lcov
lcov --remove ./lcov.info -o ./clean_lcov.info 'test/*' 'script/*' 'src/zkbob/verifiers/*'
lcov --list clean_lcov.info
- name: Report code coverage
uses: zgosalvez/github-actions-report-lcov@v2
with:
coverage-files: ./clean_lcov.info
artifact-name: solidity-coverage-report
working-directory: ./