-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New foundry template, sans relay
- Loading branch information
Showing
49 changed files
with
2,997 additions
and
3,208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,5 @@ | ||
[build] | ||
rustflags = [ | ||
"-Dclippy::correctness", | ||
"-Dclippy::suspicious", | ||
"-Wclippy::complexity", | ||
"-Wclippy::perf", | ||
"-Wclippy::style", | ||
"-Wclippy::unwrap_used", | ||
"-Wclippy::expect_used", | ||
"-Dclippy::needless_return", | ||
"-Dbad_style", | ||
"-Dbare_trait_objects", | ||
"-Ddead_code", | ||
"-Dimproper_ctypes", | ||
"-Dno_mangle_generic_items", | ||
"-Dnon_shorthand_field_patterns", | ||
"-Doverflowing_literals", | ||
"-Dpath_statements", | ||
"-Dpatterns_in_fns_without_body", | ||
"-Dtrivial_casts", | ||
"-Dtrivial_numeric_casts", | ||
"-Dunconditional_recursion", | ||
"-Dunused_allocation", | ||
"-Dunused_comparisons", | ||
"-Wunused_extern_crates", | ||
"-Dunused_parens", | ||
"-Dwhile_true", | ||
] | ||
rustflags = ["-Dclippy::all", "-Dwarnings"] | ||
|
||
[net] | ||
git-fetch-with-cli = true |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: test | ||
name: main | ||
|
||
on: | ||
push: | ||
|
@@ -13,27 +13,26 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
env: | ||
RUST_BACKTRACE: "1" | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
RISC0_VERSION: 0.20.1 | ||
RISC0_TOOLCHAIN_VERSION: test-release-2 | ||
RUST_BACKTRACE: "1" | ||
RISC0_CRATE_VERSION: "^0.20" | ||
RISC0_TOOLCHAIN_VERSION: v2024-01-31.1 | ||
|
||
jobs: | ||
integration: | ||
name: local mock relay integration tests | ||
runs-on: [self-hosted, prod, Linux, X64] | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842 | ||
- name: checkout dummy commit (submodule bug workaround) | ||
run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :" | ||
|
||
- name: clone repository | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: install rust | ||
uses: risc0/risc0/.github/actions/rustup@release-0.19 | ||
- name: Install rust | ||
uses: risc0/risc0/.github/actions/rustup@release-0.20 | ||
|
||
- name: Install Foundry | ||
uses: risc0/foundry-toolchain@2fe7e70b520f62368a0e3c464f997df07ede420f | ||
|
@@ -44,34 +43,39 @@ jobs: | |
crate: cargo-binstall | ||
|
||
- name: Cargo binstall cargo-risczero | ||
run: cargo binstall -y --force cargo-risczero@${{ env.RISC0_VERSION }} | ||
run: cargo binstall -y --force cargo-risczero@${{ env.RISC0_CRATE_VERSION }} | ||
|
||
- name: risczero toolchain install | ||
run: cargo risczero install --version $RISC0_TOOLCHAIN_VERSION | ||
|
||
- name: build rust guest | ||
run: cargo build | ||
|
||
- name: build solidity contracts | ||
run: forge build | ||
|
||
- name: build rust guest | ||
run: cargo build | ||
- name: run tests | ||
run: cargo test | ||
|
||
- name: run foundry tests with local exec | ||
- name: run foundry tests in dev mode | ||
env: | ||
RISC0_DEV_MODE: true | ||
run: forge test -vvv | ||
|
||
e2e: | ||
name: end 2 end tests | ||
runs-on: [self-hosted, prod, Linux, X64] | ||
bonsai-integration: | ||
name: test bonsai integration | ||
runs-on: ubuntu-latest | ||
steps: | ||
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842 | ||
- name: checkout dummy commit (submodule bug workaround) | ||
run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :" | ||
|
||
- name: clone repository | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: install rust | ||
- name: Install rust | ||
uses: risc0/risc0/.github/actions/[email protected] | ||
|
||
- name: Install Foundry | ||
|
@@ -83,20 +87,57 @@ jobs: | |
crate: cargo-binstall | ||
|
||
- name: Cargo binstall cargo-risczero | ||
run: cargo binstall -y --force cargo-risczero@${{ env.RISC0_VERSION }} | ||
run: cargo binstall -y --force cargo-risczero@${{ env.RISC0_CRATE_VERSION }} | ||
|
||
- name: risczero toolchain install | ||
run: cargo risczero install --version $RISC0_TOOLCHAIN_VERSION | ||
|
||
- name: build solidity contracts | ||
run: forge build | ||
|
||
- name: build rust guest | ||
run: cargo build | ||
|
||
- name: run foundry tests with bonsai alpha proving | ||
- name: build solidity contracts | ||
run: forge build | ||
|
||
- name: run foundry tests with bonsai proving | ||
env: | ||
BONSAI_API_URL: ${{ secrets.BONSAI_API_URL }} | ||
BONSAI_API_KEY: ${{ secrets.BONSAI_API_KEY }} | ||
RISC0_DEV_MODE: false | ||
run: forge test -vvv | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: install rust | ||
uses: risc0/risc0/.github/actions/[email protected] | ||
|
||
- name: install cargo-sort | ||
uses: risc0/cargo-install@v1 | ||
with: | ||
crate: cargo-sort | ||
version: "=1.0.7" | ||
|
||
- name: Install Foundry | ||
uses: risc0/foundry-toolchain@2fe7e70b520f62368a0e3c464f997df07ede420f | ||
|
||
- name: lint rust code | ||
run: cargo fmt --all --check | ||
|
||
- name: lint guest rust code | ||
working-directory: methods/guest | ||
run: cargo fmt --all --check | ||
|
||
- name: lint cargo files | ||
run: cargo sort --workspace --check | ||
|
||
- name: lint guest cargo files | ||
working-directory: methods/guest | ||
run: cargo sort --workspace --check | ||
|
||
- name: check solidity code formatting | ||
run: forge fmt --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"rust-analyzer.linkedProjects": [ | ||
"./apps/Cargo.toml", | ||
"./methods/Cargo.toml", | ||
"./methods/guest/Cargo.toml", | ||
] | ||
} |
Oops, something went wrong.