GitHub action to install Foundry

Overview

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@v2
        with:
          submodules: recursive

      - name: Install Foundry
        uses: onbjerg/foundry-toolchain@v1
        with:
          version: nightly

      - name: Run tests
        run: forge test -vvv

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
Comments
  • 404 in github actions

    404 in github actions

    This action has been working great for me but suddenly (today) getting 404s:

    Run foundry-rs/foundry-toolchain@v1
      
    Error: Error: Unexpected HTTP response: 404
    
    opened by marktoda 8
  • Something in the latest versions of foundry is causing my github pipeline to fail (it was working before)

    Something in the latest versions of foundry is causing my github pipeline to fail (it was working before)

    image

    Rerunning old tests also breaks on tests that used to pass, so potentially something new in the latest foundry is causing an issue.

    It would be super nice to be able to specify a fixed version of foundry rather than nightly to prevent these kinds of issues in the future.

    Here is my pipeline:

    name: Run Contract FORGE Tests
    
    on:
      pull_request:
        paths:
          - "contracts/**/*.sol"
          - "contracts/test/**"
    
    env:
      FOUNDRY_PROFILE: ci # This foundry profile is set to test the contracts slighly more vigorously.
    
    defaults:
      run:
        working-directory: ./contracts
    
    jobs:
      run-forge-contract-tests:
        name: Run contract FORGE tests
        runs-on: ubuntu-latest
    
        steps:
          # Checks out a copy of your repository on the ubuntu-latest machine
          - name: Checkout code
            uses: actions/checkout@v2
    
          - name: Cache contract node_modules
            id: cache_contracts_node_modules
            uses: actions/cache@v2
            with:
              path: ~/work/monorepo/monorepo/contracts/node_modules
              key: ${{ runner.os }}-modules-${{ hashFiles('~/work/monorepo/monorepo/contracts/yarn.lock') }}
    
          - name: install node packages
            if: steps.cache_contracts_node_modules.outputs.cache-hit != 'true'
            id: install_node_packages_contracts
            run: |
              yarn
    
          - name: Install Foundry
            uses: onbjerg/foundry-toolchain@v1
            with:
              version: nightly # Note be careful, this might break at some point! We should fix a version rather - wasn't clear what the version was though from docs at time
    
          - name: Cache the foundry/forge cache
            id: cache_foundry_compile
            uses: actions/cache@v2
            with:
              path: |
                ~/work/monorepo/monorepo/contracts/cache
                ~/work/monorepo/monorepo/contracts/out
              key: ${{ runner.os }}-foundry-cache-v0.8.15-${{ hashFiles('~/work/monorepo/monorepo/contracts/contracts/**') }}
              restore-keys: |
                ${{ runner.os }}-foundry-cache-v0.8.15
    
          - name: Install forge dependencies
            id: run_install_dependencies
            run: |
              forge install
    
          - name: Pre-build contracts for following steps
            id: build_contracts
            run: |
              forge build #--extra-output abi --extra-output userdoc --extra-output devdoc --extra-output evm.methodIdentifiers
    
          - name: Run forge tests
            id: run_forge_tests
            run: |
              forge snapshot --check # -vvvv means that all stack and setup traces are displayed
    
          ## No benefit to running slither in the pipeline currently... 😢
          # - name: Run Slither
          #   id: slither
          #   uses: crytic/[email protected]
          #   continue-on-error: true
          #   with:
          #     ignore-compile: true
          #     node-version: 16
          #     sarif: results.sarif
    
          # # TODO:  re-add this once github has enabled this feature for our account.
          # - name: Upload SARIF file
          #   id: upload-sarif-file
          #   uses: github/codeql-action/upload-sarif@v2
          #   with:
          #     sarif_file: ${{ steps.slither.outputs.sarif }}
    

    I'm unable to replicate this failure locally, and multiple people from my team also don't have the issue locally, so it seems like it is something about how the pipeline takes the output from build.

    opened by JasoonS 5
  • Builds failing in github actions with `GLIBC_2.33' not found

    Builds failing in github actions with `GLIBC_2.33' not found

    We use the foundry-toolchain github action in our CI and it started failing recently with failures like this:

    forge: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by forge)
    forge: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by forge)
    forge: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by forge)
    

    Is there a problem with the nightly release?

    opened by KholdStare 3
  • ci: run forge snapshot with NO_COLOR=1

    ci: run forge snapshot with NO_COLOR=1

    Since the format of snapshot output messes slightly with the markdown output for GitHub steps summary. Related issue: https://github.com/foundry-rs/foundry/issues/3394.

    opened by pcaversaccio 3
  • feat(action): step summary (#2)

    feat(action): step summary (#2)

    updated the download url to new github org updated dependency documented new feature for generating CI report summary added build script added CI workflow for the action itself

    opened by sambacha 2
  • Sudden 404 running this action

    Sudden 404 running this action

    Have been using this action for several months. Here's my config:

          - name: Install Foundry
            uses: foundry-rs/foundry-toolchain@v1
            with:
              version: nightly
    

    Today, all builds started erroring out with this in logs:

    2022-08-10T23:53:09.1613407Z ##[group]Run foundry-rs/foundry-toolchain@v1
    2022-08-10T23:53:09.1613645Z with:
    2022-08-10T23:53:09.1613815Z   version: nightly
    2022-08-10T23:53:09.1614005Z ##[endgroup]
    2022-08-10T23:53:09.7820830Z ##[error]Error: Unexpected HTTP response: 404
    

    Rerun with debug logging, and found this:

    Run foundry-rs/foundry-toolchain@v1
    ##[debug]Downloading https://github.com/gakonst/foundry/releases/download/nightly/foundry_nightly_linux_amd64.tar.gz
    ##[debug]Destination /home/runner/work/_temp/b4fac0c4-7268-4a4f-b232-bbd68e7f2f9f
    ##[debug]Failed to download from "https://github.com/gakonst/foundry/releases/download/nightly/foundry_nightly_linux_amd64.tar.gz". Code(404) Message(Not Found)
    Error: Error: Unexpected HTTP response: 404
    ##[debug]Node Action run completed with exit code 1
    

    That repo redirects to foundry-rs, but that link is unreachable. Is there a new download link for the binary?

    opened by EdNoepel 1
  • fmt --check return nonsense errors on github action

    fmt --check return nonsense errors on github action

    forge fmt --check doesn't return any error on my machine. But when it comes to github action these errors are generated and the action fails

    image

    It's our github action https://github.com/Giveth/givpower/blob/4a606264587fb1a84686c95e51341c08ad712970/.github/workflows/lint.yml

    opened by aminlatifi 1
  • Support a specific nightly release

    Support a specific nightly release

    Fixes https://github.com/onbjerg/foundry-toolchain/issues/3

    Adds support for using a specific nightly release to run CI on, e.g. https://github.com/gakonst/foundry/releases/tag/nightly-6547691c6123c1bdbed770fcd245f1e63092befe.

    opened by CodeSandwich 1
  • Figure out versioning story

    Figure out versioning story

    Currently this action will assume that releases are a thing, which they are not currently. It also assumes things about the structure of release artifacts.

    It would be nice if we could also support

    • Installing nightly versions (perhaps we just release nightly versions upstream?)
    • Installing specific commits, although this requires that we also build the toolchain every time

    Possible inspirations: https://github.com/actions-rs/toolchain and https://github.com/actions-rs/core

    opened by onbjerg 1
  • Support a specific nightly release

    Support a specific nightly release

    It'd be really cool to be able to specify a specific nightly release to run CI on, e.g. https://github.com/gakonst/foundry/releases/tag/nightly-6547691c6123c1bdbed770fcd245f1e63092befe. It has a binary path unreachable using the current foundry-toolchain logic.

    Maybe if the version is detected to follow the nightly-[0-9a-f]{40} format, replace it with plain nightly when generating the filename?

    opened by CodeSandwich 0
  • Cache RPC responses

    Cache RPC responses

    See the discussion here.

    The idea would be to save and restore all the data in your ~/.foundry/cache/rpc/<chain name>/<block number> paths by default, so that users don't end up incurring additional RPC calls.

    opened by paulrberg 0
  • Feature: Support  for Feature/Beta Builds

    Feature: Support for Feature/Beta Builds

    Support development builds

    Foundry would have to add an additional identifier in its versioning to distinguish between nightly proper and dev/pr builds like

    0.2.0-pr-47126-18
    

    Also it would only work on branches in the main repo, not PR's (I think)

    Something along the lines of this:

    import * as core from '@actions/core'
    import * as tc from '@actions/tool-cache'
    
    async function run(): Promise<void> {
      try {
        const toolDir = tc.find('platform-', 'nightly-', 'x64')
        if (toolDir !== '') {
          core.addPath(toolDir)
          return
        }
    
        const channel = core.getInput('channel')
    
        // TODO: use feature/branch, github PR# for channels 
        if (!['nightly', 'edge', 'pr#', 'beta', ''].includes(channel)) {
          core.setFailed(`Unknown release channel ${channel}`)
          return
        }
    
    
          switch (process.platform) {
          case 'darwin': {
            let toolUrl =
              'https://nightly--darwin-amd64.zip'
            if (channel === 'beta') {
              toolUrl =
                'https://edge-darwin-amd64.zip'
            }
            const downloadPath = await tc.downloadTool(toolUrl)
            const extPath = await tc.extractZip(downloadPath)
            const cachedPath = await tc.cacheDir(extPath, 'release-', 'nightly-')
            core.addPath(cachedPath)
            break
          }
    
          case 'linux': {
            let toolUrl =
              'https://nightly-linux-amd64.tar.gz'
            if (channel === 'beta') {
              toolUrl =
                'https://edge-linux-amd64.tar.gz'
            }
            const downloadPath = await tc.downloadTool(toolUrl)
            const extPath = await tc.extractTar(downloadPath)
            const cachedPath = await tc.cacheDir(extPath, 'release-', 'nightly-')
            core.addPath(cachedPath)
            break
          }
    
          default: {
            core.setFailed(`Unsupported platform: ${process.platform}`)
          }
        }
      } catch (error) {
        core.setFailed(error.message)
      }
    }
    
    run()
    
    opened by sambacha 0
Releases(v1.0.7)
Owner
Bjerg
Bjerg
GitHub Action that posts the report in a comment on a GitHub Pull Request from coverage data generated by nyc (istanbul)

GitHub Action: Report NYC coverage GitHub Action that posts the report in a comment on a GitHub Pull Request from coverage data generated by nyc (ista

Sid 16 Nov 23, 2022
A GitHub action to submit your dependency graph from your Mill build to GitHub.

Mill Dependency Submission A GitHub action to submit your dependency graph from your Mill build to GitHub via their Dependency Submission API. The mai

Chris Kipp 6 Dec 15, 2022
A GitHub Action that allows to debug GitHub workflows using VS Code.

VS Code Server Action A GitHub Action that allows to debug GitHub workflows using VS Code. Failing CI builds can be annoying especially since we don't

stateful 18 Dec 23, 2022
Solidity starter combining foundry and hardhat because both are great and I can't live without either...

Combination Pizza Hut & Taco Bell Foundry && HardHat starter template. Motivation I like them both. With this set-up we get: Unit tests written in sol

Cache Monet 32 Aug 23, 2022
Library for Foundry VTT which provides easy access to dark comedy fantasy setting created by Richard Zadmar Woolcock

Library for Foundry VTT which provides easy access to dark comedy fantasy setting created by Richard Zadmar Woolcock. Current inclusions are a bestiary, edges, hindrances, and a journal with setting information, character creation, and more. The Savage Worlds Adventurers Edition Game System is the system this setting is designed for.

KevDog 2 Mar 18, 2022
Use Hardhat & Foundry in the same project

Hardhat Foundry Starter This is a solidity starter template which lets you use both, Hardhat and Foundry. Why use both the tools? Foundry has some awe

Rajdeep Bharati 12 Aug 23, 2022
Minimal template to get started with Foundry + Hardhat

Hardhat x Foundry Template Template repository for getting started quickly with Hardhat and Foundry in one project Getting Started Use Foundry: forge

Foundry 158 Jan 3, 2023
A module to integrate World Anvil with Foundry Virtual Tabletop.

Foundry Virtual Tabletop - World Anvil Integration This module provides an integration with World Anvil for Foundry Virtual Tabletop, allowing you to

Foundry Virtual Tabletop 5 Sep 7, 2022
An implementation of the Dungeons & Dragons 5th Edition game system for Foundry Virtual Tabletop

An implementation of the Dungeons & Dragons 5th Edition game system for Foundry Virtual Tabletop.

Foundry Virtual Tabletop 103 Jan 2, 2023
🛠️ Easily track & compare gas costs estimated by Foundry on each of your Pull Requests!

?? ??️ Foundry Gas Diff Reporter Easily compare gas reports generated by Foundry automatically on each of your Pull Requests! How it works Everytime s

Romain Milon 133 Dec 28, 2022
A module for modifying sheet rolling functions on Foundry VTT Character sheets for D&D 5th Edition.

Ready Set Roll for 5e - FoundryVTT Module Ready Set Roll is a Foundry VTT module that accelerates the built in rolling system of the Foundry DnD5e sys

Mangó 17 Dec 12, 2022
Instruction how to install laravel echo and pusher without vuejs or even npm

This 2 .js files are used to listen from server broadcasting with laravel-websockets, so that you don't need the use of Vue.js in your laravel app Fol

Muath Assawadi 7 Sep 28, 2022
A Node.JS tool to automatically install or update your FiveM server artifacts.

ItsANoBrainer FiveM Artifact Updater FiveM Artifact Updater is an application created with Node.JS to easily and quickly install/update your artifacts

null 23 Dec 8, 2022
Quick programmatically install npm dependencies 📦

qpind Install dependecies quick & programmatically ?? Install # Using npm: npm install qpind # Using pnpm: pnpm add qpind # Using yarn: yarn add qpind

Conner 15 Oct 6, 2022
Open apps directly in GNOME Software by clicking Install from Flathub and apps.gnome.

Flatline Open apps directly in GNOME Software by clicking Install from Flathub and apps.gnome. Load the extension in Firefox Clone the repository Open

Cleo Menezes Jr. 43 Nov 7, 2022
A tool to install ubuntu mainline kernels from the console.

Ubuntu Kernel Tool A tool to list, download, and install mainline kernels from the Ubuntu mainline repository. ULTIMATE DISCLAIMER: DO NOT USE THIS TO

Abdullah A. Hassan 9 Jan 21, 2022
Service Installer for VMware Tanzu is a one-click automation solution that enables VMware field engineers to easily and rapidly install, configure, and operate VMware Tanzu services across a variety of cloud infrastructures.

Service Installer for VMware Tanzu Service Installer for VMware Tanzu seeks to provide a one-click automation solution to enable our VMware engineers

VMware Tanzu 42 Dec 1, 2022
This is a project that is used to execute python codes in the web page. You can install and use it in django projects, You can do any operations that can be performed in python shell with this package.

Django execute code This is a project that is used to execute python codes in the web page. You can install and use it in django projects, You can do

Shinu 5 Nov 12, 2022
🎨 VS Code extension for antd v5 design token. Install it now!👇

antd design token VSCode extension for antd v5 design token. Features Provide the hover hint and editor decorations of antd v5 design token, include c

社长长 12 Dec 30, 2022