forked from AztecProtocol/aztec-connect
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some Rust smoketesting CI for barretenberg_wrapper (#14)
* Cargo format * Clippy fixes * Update tests to match tests in aztec_backend * Add cargo config to set clang as linker when target is x86_64-unknown-linux-gnu
- Loading branch information
Showing
5 changed files
with
112 additions
and
11 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 |
---|---|---|
@@ -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] | ||
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