Skip to content

Commit

Permalink
chore(ci)!: Bump MSRV to 1.72.1 and enforce that ACVM can be publishe…
Browse files Browse the repository at this point in the history
…d using updated lockfile (#4385)

# Description

## Problem\*

Resolves #4384 

## Summary\*

This PR resolves #4384 by updating the lockfile so that it's using the
latest versions of the dependencies used by all of the ACVM packages and
then runs the test suite against it to ensure that we still work
correctly.

## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.

---------

Co-authored-by: kevaundray <[email protected]>
  • Loading branch information
TomAFrench and kevaundray authored Feb 15, 2024
1 parent 1fbc6ab commit 2fc95d2
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 2 deletions.
112 changes: 112 additions & 0 deletions .github/workflows/test-rust-workspace-msrv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Test (MSRV check)

# TL;DR https://github.com/noir-lang/noir/issues/4384
#
# This workflow acts to ensure that we can publish to crates.io, we need this extra check as libraries don't respect the Cargo.lock file committed in this repository.
# We must then always be able to build the workspace using the latest versions of all of our dependencies, so we explicitly update them and build in this workflow.

on:
pull_request:
merge_group:
push:
branches:
- master

# This will cancel previous runs when a branch or PR is updated
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true

jobs:
build-test-artifacts:
name: Build test artifacts
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/[email protected]
with:
targets: x86_64-unknown-linux-gnu

# We force the ACVM crate and all of its dependencies to update their dependencies
# This ensures that we'll be able to build the crates when they're being published.
- name: Update Cargo.lock
run: |
cargo update --package acvm --aggressive
cargo update --package bn254_blackbox_solver --aggressive
- uses: Swatinem/rust-cache@v2
with:
key: x86_64-unknown-linux-gnu-msrv-check
cache-on-failure: true
save-if: ${{ github.event_name != 'merge_group' }}

- name: Install nextest
uses: taiki-e/install-action@v2
with:
tool: [email protected]

- name: Build and archive tests
run: cargo nextest archive --workspace --release --archive-file nextest-archive.tar.zst

- name: Upload archive to workflow
uses: actions/upload-artifact@v4
with:
name: nextest-archive
path: nextest-archive.tar.zst

run-tests:
name: "Run tests (partition ${{matrix.partition}})"
runs-on: ubuntu-latest
needs: [build-test-artifacts]
strategy:
fail-fast: false
matrix:
partition: [1, 2, 3, 4]
steps:
- uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/[email protected]
with:
targets: x86_64-unknown-linux-gnu

- name: Install nextest
uses: taiki-e/install-action@v2
with:
tool: [email protected]

- name: Download archive
uses: actions/download-artifact@v4
with:
name: nextest-archive
- name: Run tests
run: |
cargo nextest run --archive-file nextest-archive.tar.zst \
--partition count:${{ matrix.partition }}/4
# This is a job which depends on all test jobs and reports the overall status.
# This allows us to add/remove test jobs without having to update the required workflows.
tests-end:
name: Rust End
runs-on: ubuntu-latest
# We want this job to always run (even if the dependant jobs fail) as we want this job to fail rather than skipping.
if: ${{ always() }}
needs:
- run-tests

steps:
- name: Report overall success
run: |
if [[ $FAIL == true ]]; then
exit 1
else
exit 0
fi
env:
# We treat any cancelled, skipped or failing jobs as a failure for the workflow as a whole.
FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

rustToolchain = fenix.packages.${system}.fromToolchainFile {
file = ./rust-toolchain.toml;
sha256 = "sha256-R0F0Risbr74xg9mEYydyebx/z0Wu6HI0/KWwrV30vZo=";
sha256 = "sha256-dxE7lmCFWlq0nl/wKcmYvpP9zqQbBitAQgZ1zx9Ooik=";
};

craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain;
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "1.71.1"
channel = "1.72.1"
components = [ "rust-src" ]
targets = [ "wasm32-unknown-unknown", "wasm32-wasi", "aarch64-apple-darwin" ]
profile = "default"

0 comments on commit 2fc95d2

Please sign in to comment.