-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (68 loc) · 2.82 KB
/
pr.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
# This workflow builds docker image to run rebalance script.
name: Smart Contracts PR Workflow
# Controls when the workflow will run
on:
# Triggers the workflow on PR
pull_request:
types: [opened, synchronize, reopened]
branches: [master]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
sanity-check:
name: PR Sanity Check
runs-on: ubuntu-latest
env:
MNEMONIC: ${{ secrets.MNEMONIC }}
ALCHEMY_ETH_GOERLI_KEY: ${{ secrets.ALCHEMY_ETH_GOERLI_KEY }}
ALCHEMY_POLYGON_MUMBAI_KEY: ${{ secrets.ALCHEMY_POLYGON_MUMBAI_KEY }}
ALCHEMY_BASE_MAINNET_KEY: ${{ secrets.ALCHEMY_BASE_MAINNET_KEY }}
ALCHEMY_ETH_MAINNET_KEY: ${{ secrets.ALCHEMY_ETH_MAINNET_KEY }}
ALCHEMY_POLYGON_MAINNET_KEY: ${{ secrets.ALCHEMY_POLYGON_MAINNET_KEY }}
DEFENDER_API_KEY: ${{ secrets.DEFENDER_API_KEY }}
DEFENDER_API_SECRET: ${{ secrets.DEFENDER_API_SECRET }}
FOUNDRY_PROFILE: ci
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Reconfigure git to use HTTP authentication
run: >
git config --global url."https://github.com/".insteadOf
ssh://[email protected]/
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d
- name: Install yarn dependencies, and compile contracts
run: yarn --frozen-lockfile && yarn build
- name: Check lint errors
run: yarn lint
- name: Check formatting errors
run: yarn format
- name: Typescript compiles correctly
run: yarn build-hh && yarn tsc
# Fuzz tests are included by default
- name: Check gas snapshots.
run: yarn snap --check --tolerance 2
- name: Generate coverage report
run: forge coverage --report lcov
- name: Report code coverage
uses: zgosalvez/github-actions-report-lcov@v1
with:
coverage-files: lcov.info
minimum-coverage: 10
artifact-name: code-coverage-report
github-token: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./
# TODO: add back once slither works again (https://github.com/crytic/slither/issues/1211)
# - name: Check slither errors
# uses: crytic/[email protected]
# id: slither
# continue-on-error: true
# with:
# sarif: results.sarif
# TODO: add back once we have code scanning (https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository#setting-up-code-scanning-manually)
# - name: Upload SARIF file
# uses: github/codeql-action/upload-sarif@v1
# with:
# sarif_file: ${{ steps.slither.outputs.sarif }}