Merge pull request #220 from pegahcarter/master #595
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
quick-checks-unit-tests: | |
name: Forge unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v2 | |
- name: Install JavaScript dependencies | |
run: npm install | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
- name: Run solhint lint check | |
run: npm run lint:check | |
- name: Install submodules | |
run: forge install | |
- name: Check gas snapshots | |
run: forge snapshot | |
- name: Run tests | |
run: forge test --optimize | |
- name: Run coverage | |
run: forge coverage --report summary --report lcov | |
- name: Filter coverage directories | |
run: | | |
sudo apt update && sudo apt install -y lcov | |
lcov --remove lcov.info 'src/TokenURIGenerator.sol' 'src/interfaces/*' 'test/*' 'script/*' --output-file lcov.info --rc lcov_branch_coverage=1 | |
- uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
static-analysis: | |
name: Slither static analysis | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Install submodules | |
run: forge install | |
- name: Run Slither | |
uses: crytic/[email protected] | |
with: | |
target: "src/" | |
slither-config: slither.config.json | |
sarif: results.sarif | |
fail-on: high |