From 2e6b9c4652631893b17747187397c6ddd6a0a9a4 Mon Sep 17 00:00:00 2001 From: Samuel Burnham <45365069+samuelburnham@users.noreply.github.com> Date: Thu, 23 Jan 2025 19:18:25 -0500 Subject: [PATCH 1/2] ci: Add basic Rust CI --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++ examples/acc-linear-combination.rs | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..5c78c9c3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: Tests + +on: + pull_request: + push: + branches: main + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + repository: argumentcomputer/ci-workflows + - uses: ./.github/actions/ci-env + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: taiki-e/install-action@nextest + - uses: Swatinem/rust-cache@v2 + - name: Tests + run: cargo nextest run --release --profile ci --workspace --run-ignored all + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + repository: argumentcomputer/ci-workflows + - uses: ./.github/actions/ci-env + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: Check Rustfmt Code Style + run: cargo fmt --all --check + - name: check *everything* compiles + run: cargo check --workspace --all-targets --all-features + - name: Check clippy warnings + run: cargo clippy --workspace --all-targets --all-features -- -D warnings + - name: Doctests + run: cargo test --doc --workspace diff --git a/examples/acc-linear-combination.rs b/examples/acc-linear-combination.rs index a1ea45d9..d73efbdd 100644 --- a/examples/acc-linear-combination.rs +++ b/examples/acc-linear-combination.rs @@ -94,7 +94,7 @@ fn main() { let log_size = 1usize; // Define set of bytes that we want to decompose - let p_in = unconstrained::(&mut builder, format!("p_in"), log_size).unwrap(); + let p_in = unconstrained::(&mut builder, "p_in".to_string(), log_size).unwrap(); let _ = bytes_decomposition_gadget(&mut builder, "bytes decomposition", log_size, p_in).unwrap(); From c592cb64ca01c88e22d33c79e9c881b5db65ba0c Mon Sep 17 00:00:00 2001 From: Samuel Burnham <45365069+samuelburnham@users.noreply.github.com> Date: Thu, 23 Jan 2025 19:22:48 -0500 Subject: [PATCH 2/2] Fix test flags --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c78c9c3..6962bb43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - uses: taiki-e/install-action@nextest - uses: Swatinem/rust-cache@v2 - name: Tests - run: cargo nextest run --release --profile ci --workspace --run-ignored all + run: cargo nextest run --cargo-profile test --workspace --run-ignored all lint: runs-on: ubuntu-latest