Skip to content

commit new reports

commit new reports #71

Workflow file for this run

name: CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
check:
strategy:
fail-fast: true
matrix:
foundry_profile: ["test-via-ir", "test-no-ir"]
name: Foundry project
runs-on: ubuntu-latest
env:
FOUNDRY_PROFILE: ${{ matrix.foundry_profile }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Show Forge version
run: |
forge --version
- name: Run Forge fmt
run: |
forge fmt --check
id: fmt
- name: Run Forge build
run: |
forge build --sizes
id: build
# This `forge snapshot` command is only used for CBORDecoder comparison.
# https://book.getfoundry.sh/forge/gas-section-snapshots
- name: Confirm comparison snapshot
run: |
forge snapshot --check ${{ env.FOUNDRY_PROFILE }}.gas-snapshot \
--match-path "test/comparison/*"
id: comparison-snapshot
- name: Run remaining Forge tests, confirm section snapshots
run: |
forge test -vvv \
--no-match-path "test/comparison/*"
git diff --exit-code snapshots-${{ env.FOUNDRY_PROFILE }}
id: test
# Coverage testing affects gas cost, and creates different snapshots.
# Only `lcov.info` is diffed to confirm coverage is checked in. Coverage
# doesn't use the 'comparison' tests.
- name: Confirm coverage
run: |
forge coverage --report-file ${{ env.FOUNDRY_PROFILE }}.lcov.info \
--report lcov --report summary \
--no-match-path "test/comparison/*" \
--no-match-coverage "test/comparison/*"
git diff --exit-code ${{ env.FOUNDRY_PROFILE }}.lcov.info
id: diff-coverage