forked from AztecProtocol/aztec-connect
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some Rust smoketesting CI for barretenberg_wrapper #14
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
68b221b
Add some Rust smoketesting CI for barretenberg_wrapper
phated 261e33d
Cargo format
phated 1fe4d1a
Clippy fixes
phated f4936a5
Update tests to match tests in aztec_backend
phated 08a95c5
Add cargo config to set clang as linker when target is x86_64-unknown…
phated ac06c1d
Merge branch 'kw/noir-dsl' into bb/rust-smoketests
phated File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Rust | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
check_n_test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- macos-latest | ||
toolchain: | ||
- stable | ||
- nightly | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: ${{ matrix.toolchain }} | ||
override: true | ||
|
||
- name: Install dependencies | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
run: sudo apt update && sudo apt install libomp-dev | ||
|
||
- name: Install dependencies | ||
if: ${{ matrix.os == 'macos-latest' }} | ||
run: brew install llvm libomp cmake | ||
|
||
- name: Run cargo check | ||
working-directory: "./barretenberg_wrapper" | ||
run: | | ||
cargo +${{ matrix.toolchain }} check --all-targets --verbose | ||
|
||
- name: Run cargo test | ||
working-directory: "./barretenberg_wrapper" | ||
run: | | ||
cargo +${{ matrix.toolchain }} test | ||
|
||
clippy: | ||
name: cargo clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
components: rustfmt, clippy | ||
|
||
- name: Install dependencies | ||
run: sudo apt update && sudo apt install libomp-dev | ||
|
||
- name: Run cargo clippy | ||
working-directory: "./barretenberg_wrapper" | ||
run: | | ||
cargo clippy -- -D warnings | ||
|
||
format: | ||
name: cargo fmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
components: rustfmt, clippy | ||
|
||
- name: Install dependencies | ||
run: sudo apt update && sudo apt install libomp-dev | ||
|
||
- name: Run cargo fmt | ||
working-directory: "./barretenberg_wrapper" | ||
run: | | ||
cargo fmt --all -- --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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This ensures Clang (instead of GCC) is used as a linker on Linux. | ||
# See https://github.com/rust-lang/rust/issues/71515#issuecomment-935020057 | ||
# These should apply when used as a library, as per | ||
# https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure | ||
[target.x86_64-unknown-linux-gnu] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe we'll want to add something similar for |
||
rustflags = ["-C", "linker=clang", "-C", "link-arg=-fuse-ld=lld"] |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This currently runs CI twice on PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running the PR twice is actually good because a
push
runs with the branch as it's own base andpull_request
runs with the upstream as the base.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow on this. When you say "with the upstream as the base" do you mean "as if the PR were rebased on top of the branch being merged into"? I haven't heard anything about
push
andpull_request
treating the same commit differently.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
Thus, the checkout action running on something triggered by
pull_request
will checkout a merge between the upstream and the PR and test it. Andpush
just checks out to the commit that is pushed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, interesting. I didn't know that GH did that temporary merge for
pull_request
.Personally I generally try to avoid merging branches into a base branch which is ahead of it (e.g. through first merging back into the PR branch) to check this explicitly rather than relying on GH.