release/2.5.0 -> master #18175
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: 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: | |
# Foundry is only used for Solidity v0.8 contracts, therefore we can ignore | |
# changes to older contracts. | |
filters: | | |
src: | |
- 'contracts/src/v0.8/**/*' | |
- '.github/workflows/solidity-foundry.yml' | |
- 'contracts/foundry.toml' | |
tests: | |
strategy: | |
matrix: | |
product: [ vrf, automation, llo-feeds, functions, automation-dev, shared ] | |
needs: [changes] | |
if: needs.changes.outputs.changes == 'true' | |
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 | |
uses: ./.github/actions/setup-nodejs | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Run Forge build | |
run: | | |
forge --version | |
forge build | |
id: build | |
working-directory: contracts | |
env: | |
FOUNDRY_PROFILE: ${{ matrix.product }} | |
- name: Run Forge tests | |
run: | | |
forge test -vvv | |
id: test | |
working-directory: contracts | |
env: | |
FOUNDRY_PROFILE: ${{ matrix.product }} | |
- name: Run Forge snapshot | |
run: | | |
forge snapshot --check gas-snapshots/${{ matrix.product }}.gas-snapshot | |
id: snapshot | |
working-directory: contracts | |
env: | |
FOUNDRY_PROFILE: ${{ matrix.product }} | |
- name: Collect Metrics | |
if: always() | |
id: collect-gha-metrics | |
uses: smartcontractkit/push-gha-metrics-action@d2c2b7bdc9012651230b2608a1bcb0c48538b6ec | |
with: | |
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }} | |
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }} | |
this-job-name: Foundry Tests ${{ matrix.product }} | |
continue-on-error: true |