Skip to content

Move KeySpecific field #12542

Move KeySpecific field

Move KeySpecific field #12542

name: Solidity Foundry
on: [pull_request]
env:
FOUNDRY_PROFILE: ci
jobs:
changes:
name: Detect changes
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.changes.outputs.src }}
steps:
- name: Checkout the repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
id: changes
with:
filters: |
src:
- 'contracts/**/*'
- '.github/workflows/solidity-foundry.yml'
tests:
needs: [changes]
name: Tests
# See https://github.com/foundry-rs/foundry/issues/3827
runs-on: ubuntu-22.04
steps:
- name: Checkout the repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
submodules: recursive
# Only needed because we use the NPM versions of packages
# and not native Foundry. This is to make sure the dependencies
# stay in sync.
- name: Setup NodeJS
if: ${{ needs.changes.outputs.changes == 'true' }}
uses: ./.github/actions/setup-nodejs
- name: Install Foundry
if: ${{ needs.changes.outputs.changes == 'true' }}
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Forge build
if: ${{ needs.changes.outputs.changes == 'true' }}
run: |
forge --version
forge build --sizes
id: build
working-directory: contracts
- name: Run Forge tests
if: ${{ needs.changes.outputs.changes == 'true' }}
run: |
forge test -vvv
id: test
working-directory: contracts
- name: Run Forge snapshot
if: ${{ needs.changes.outputs.changes == 'true' }}
run: |
forge snapshot --match-test _gas --check
id: snapshot
working-directory: contracts
- name: Collect Metrics
if: always()
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@90fcbaac8ebf86da9c4d55dba24f6fe3029f0e0b
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: Foundry Tests
continue-on-error: true