Skip to content

Commit

Permalink
Merge branch 'main' into tests/invariant-handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Karrq committed Sep 20, 2024
2 parents 05f2e2e + bdc215d commit 062a19c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 22 deletions.
43 changes: 22 additions & 21 deletions .github/workflows/bump-forge-std.yml
Original file line number Diff line number Diff line change
@@ -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
13 changes: 12 additions & 1 deletion crates/forge/bin/cmd/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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)?;
Expand Down
4 changes: 4 additions & 0 deletions crates/forge/bin/cmd/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 062a19c

Please sign in to comment.