chore: add v3 deployment #1007
Workflow file for this run
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: | |
# CI is run on main because new branches can only access caches from master, not previous branches. | |
# So building on master allows new PR's to get the cache from before. | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
FOUNDRY_PROFILE: ci | |
L1_MAINNET_RPC_URL: ${{ secrets.L1_MAINNET_RPC_URL }} | |
L2_MAINNET_RPC_URL: ${{ secrets.L2_MAINNET_RPC_URL }} | |
jobs: | |
test: | |
strategy: | |
fail-fast: true | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Run forge build | |
run: | | |
forge --version | |
forge build --sizes | |
- name: Run forge fmt | |
run: forge fmt --check | |
- name: Run forge tests | |
run: forge test -vvv | |
- name: Check forge snapshots | |
run: forge snapshot --check --match-contract Gas | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
- name: Check code coverage | |
run: forge coverage --report summary --report lcov | |
# Ignores coverage results for the test and script directories. Note that because this | |
# filtering applies to the lcov file, the summary table generated in the previous step will | |
# still include all files and directories. | |
# The `--rc lcov_branch_coverage=1` part keeps branch info in the filtered report, since lcov | |
# defaults to removing branch info. | |
- name: Filter directories | |
run: | | |
sudo apt update && sudo apt install -y lcov | |
lcov --remove lcov.info 'test/*' 'script/*' --output-file lcov.info --rc lcov_branch_coverage=1 | |
# Post a detailed coverage report as a comment and deletes previous comments on each push. | |
- name: Post coverage report | |
if: github.event_name == 'pull_request' # This action fails when ran outside of a pull request. | |
uses: romeovs/[email protected] | |
with: | |
delete-old-comments: true | |
lcov-file: ./lcov.info | |
github-token: ${{ secrets.GITHUB_TOKEN }} # Adds a coverage summary comment to the PR. | |
# Fail coverage if the specified coverage threshold is not met | |
- name: Verify minimum coverage | |
uses: zgosalvez/github-actions-report-lcov@v2 | |
with: | |
coverage-files: ./lcov.info | |
minimum-coverage: 94 |