-
Notifications
You must be signed in to change notification settings - Fork 2
72 lines (56 loc) · 1.66 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
name: ci
on:
push:
branches:
- main
pull_request:
env:
RPC_URL: ${{ secrets.RPC_URL }}
jobs:
run-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-node@v3
- name: Install node dependencies
run: npm install
- name: Set up python
id: setup-python
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install python dependencies
run: poetry install --no-interaction
- name: Install Foundry
uses: onbjerg/foundry-toolchain@v1
with:
version: nightly
- name: Pull Submodules
run: forge update
- name: Check formatting
run: npm run format:check
- name: Check linting
run: npm run lint:check
- name: Run tests
run: forge test --optimize --fork-url ${{ env.RPC_URL }}
- name: Coverage
run: |
sudo apt update && sudo apt install -y lcov
npm run coverage
id: coverage
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
# Too slow to run regularly
#- name: Run audit
# run: poetry run slither --solc-remaps @openzeppelin=lib/openzeppelin-contracts --solc-args optimize src/