npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@brotherlymite/foundry-zksync-test-toolchain

v1.0.8

Published

This GitHub Action installs [Foundry](https://github.com/foundry-rs/foundry), the blazing fast, portable and modular toolkit for Ethereum application development.

Downloads

2

Readme

foundry-toolchain Action

This GitHub Action installs Foundry, the blazing fast, portable and modular toolkit for Ethereum application development.

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

      - name: Run tests
        run: forge test -vvv

      - name: Run snapshot
        run: forge snapshot

Inputs

| Name | Required | Default | Description | Type | | -------------------- | ------------ | ------------------------------------- | ------------------------------------------------------------------------------------------------------------ | -------- | | cache | No | true | Whether to cache RPC responses or not. | bool | | version | No | nightly | Version to install, e.g. nightly or 1.0.0. Note: Foundry only has nightly builds for the time being. | string | | cache-key | No | ${{ github.job }}-${{ github.sha }} | The cache key to use for caching. | string | | cache-restore-keys | No | [${{ github.job }}-] | The cache keys to use for restoring the cache. | string[] |

RPC Caching

By default, this action matches Forge's behavior and caches all RPC responses in the ~/.foundry/cache/rpc directory. This is done to speed up the tests and avoid hitting the rate limit of your RPC provider.

The logic of the caching is as follows:

  • Always load the latest valid cache, and always create a new one with the updated cache.
  • When there are no changes to the fork tests, the cache does not change but the key does, since the key is based on the commit hash.
  • When the fork tests are changed, both the cache and the key are updated.

If you would like to disable the caching (e.g. because you want to implement your own caching mechanism), you can set the cache input to false, like this:

- name: Install Foundry
  uses: foundry-rs/foundry-toolchain@v1
  with:
    cache: false

Custom Cache Keys

You have the ability to define custom cache keys by utilizing the cache-key and cache-restore-keys inputs. This feature is particularly beneficial when you aim to tailor the cache-sharing strategy across multiple jobs. It is important to ensure that the cache-key is unique for each execution to prevent conflicts and guarantee successful cache saving.

For instance, if you wish to utilize a shared cache between two distinct jobs, the following configuration can be applied:

- name: Install Foundry
  uses: foundry-rs/foundry-toolchain@v1
  with:
    cache-key: custom-seed-test-${{ github.sha }}
    cache-restore-keys: |-
      custom-seed-test-
      custom-seed-
---
- name: Install Foundry
  uses: foundry-rs/foundry-toolchain@v1
  with:
    cache-key: custom-seed-coverage-${{ github.sha }}
    cache-restore-keys: |-
      custom-seed-coverage-
      custom-seed-

Deleting Caches

You can delete caches via the GitHub Actions user interface. Just go to your repo's "Actions" page:

https://github.com/<OWNER>/<REPO>/actions/caches

Then, locate the "Management" section, and click on "Caches". You will see a list of all of your current caches, which you can delete by clicking on the trash icon.

For more detail on how to delete caches, read GitHub's docs on managing caches.

Fuzzing

Note that if you are fuzzing in your fork tests, the RPC cache strategy above will not work unless you set a fuzz seed. You might also want to reduce your number of RPC calls by using Multicall.

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: NO_COLOR=1 forge snapshot >> $GITHUB_STEP_SUMMARY

See the official GitHub docs for more information.

Building

When opening a PR, you must build the action exactly following the below steps for CI to pass:

$ npm ci
$ npm run build

You have to use Node.js 20.x.