scUSDS Improvement (#166) #730
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: Tests + Coverage | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
env: | |
FOUNDRY_PROFILE: ci | |
jobs: | |
check: | |
strategy: | |
fail-fast: true | |
name: Foundry project | |
runs-on: ubuntu-latest | |
env: | |
RPC_URL_MAINNET: ${{ secrets.RPC_URL_MAINNET }} | |
RPC_URL_GOERLI: ${{ secrets.RPC_URL_GOERLI }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Install Dependencies | |
run: | | |
forge --version | |
FOUNDRY_PROFILE=ci forge install | |
id: dependencies | |
- name: Run Forge build | |
run: | | |
forge --version | |
forge build --sizes | |
id: build | |
- name: Run Forge tests | |
run: | | |
FOUNDRY_PROFILE=ci forge test -vvv | |
id: test | |
- name: Run Forge Formatting Check | |
run: | | |
FOUNDRY_PROFILE=ci forge fmt --check | |
id: fmt | |
- name: Run Forge Coverage | |
run: | | |
FOUNDRY_PROFILE=ci forge coverage --report lcov | |
id: coverage | |
- name: Prune lcov report | |
run: | | |
sudo apt-get install lcov | |
lcov --remove ./lcov.info -o ./lcov.info 'script/*' 'test/*' | |
- name: Coveralls GitHub Action | |
uses: coverallsapp/[email protected] | |
with: | |
path-to-lcov: lcov.info |