foundry-toolchain icon indicating copy to clipboard operation
foundry-toolchain copied to clipboard

GitHub action to install Foundry

foundry-toolchain Action

This GitHub Action installs Foundry.

Example workflow

on: [push]

name: test

jobs:
  check:
    name: Foundry project
    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 tests
        run: forge test -vvv

      - name: Run snapshot
        run: forge snapshot

Inputs

Name Required Description Type
version Yes Version to install, e.g. nightly or 1.0.0. Note: Foundry only has nightly builds for the time being. string

Summaries

You can add the output of Forge and Cast commands to GitHub step summaries. The summaries support GitHub flavored Markdown.

For example, to add the output of forge snapshot to a summary, you would change the snapshot step to:

- name: Run snapshot
  run: forge snapshot >> $GITHUB_STEP_SUMMARY

See the offical GitHub docs for more information.