diff --git a/.github/workflows/bump-forge-std.yml b/.github/workflows/bump-forge-std.yml index 137e8c465..2814cc87c 100644 --- a/.github/workflows/bump-forge-std.yml +++ b/.github/workflows/bump-forge-std.yml @@ -1,25 +1,26 @@ # Daily CI job to update forge-std version used for tests if new release has been published +# Disabled as we update it via upstream sync or manually -name: bump-forge-std +# name: bump-forge-std -on: - schedule: - - cron: "0 0 * * *" - workflow_dispatch: +# on: +# schedule: +# - cron: "0 0 * * *" +# workflow_dispatch: -jobs: - update-tag: - name: update forge-std tag - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Fetch and update forge-std tag - run: curl 'https://api.github.com/repos/foundry-rs/forge-std/tags' | jq '.[0].commit.sha' -jr > testdata/forge-std-rev - - name: Create pull request - uses: peter-evans/create-pull-request@v5 - with: - commit-message: "chore: bump forge-std version used for tests" - title: "chore(tests): bump forge-std version" - body: | - New release of forge-std has been published, bump forge-std version used in tests. Likely some fixtures need to be updated. - branch: chore/bump-forge-std +# jobs: +# update-tag: +# name: update forge-std tag +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - name: Fetch and update forge-std tag +# run: curl 'https://api.github.com/repos/foundry-rs/forge-std/tags' | jq '.[0].commit.sha' -jr > testdata/forge-std-rev +# - name: Create pull request +# uses: peter-evans/create-pull-request@v5 +# with: +# commit-message: "chore: bump forge-std version used for tests" +# title: "chore(tests): bump forge-std version" +# body: | +# New release of forge-std has been published, bump forge-std version used in tests. Likely some fixtures need to be updated. +# branch: chore/bump-forge-std diff --git a/crates/forge/bin/cmd/init.rs b/crates/forge/bin/cmd/init.rs index 1882eca60..54d871158 100644 --- a/crates/forge/bin/cmd/init.rs +++ b/crates/forge/bin/cmd/init.rs @@ -44,7 +44,7 @@ pub struct InitArgs { impl InitArgs { pub fn run(self) -> Result<()> { let Self { root, template, branch, opts, offline, force, vscode } = self; - let DependencyInstallOpts { shallow, no_git, no_commit, quiet } = opts; + let DependencyInstallOpts { shallow, no_git, no_commit, quiet, zksync } = opts; // create the root dir if it does not exist if !root.exists() { @@ -153,6 +153,17 @@ impl InitArgs { } } + // install forge-zksync-std + if zksync && !offline { + if root.join("lib/forge-zksync-std").exists() { + p_println!(!quiet => "\"lib/forge-zksync-std\" already exists, skipping install...."); + self.opts.install(&mut config, vec![])?; + } else { + let dep = "https://github.com/Moonsong-Labs/forge-zksync-std".parse()?; + self.opts.install(&mut config, vec![dep])?; + } + } + // init vscode settings if vscode { init_vscode(&root)?; diff --git a/crates/forge/bin/cmd/install.rs b/crates/forge/bin/cmd/install.rs index 57096f859..77fad0282 100644 --- a/crates/forge/bin/cmd/install.rs +++ b/crates/forge/bin/cmd/install.rs @@ -81,6 +81,10 @@ pub struct DependencyInstallOpts { /// Do not print any messages. #[arg(short, long)] pub quiet: bool, + + /// Install ZKsync specific libraries. + #[arg(long)] + pub zksync: bool, } impl DependencyInstallOpts {