From ae167f5d12f0fce5ab8508d6f3e086b415f0ac2c Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 3 Sep 2024 13:30:59 +0100 Subject: [PATCH 1/3] chore: add CI --- .github/NIGHTLY_CANARY_DIED.md | 8 +++++ .github/workflows/nightly-canary.yml | 40 +++++++++++++++++++++++++ .github/workflows/test.yml | 44 ++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 .github/NIGHTLY_CANARY_DIED.md create mode 100644 .github/workflows/nightly-canary.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/NIGHTLY_CANARY_DIED.md b/.github/NIGHTLY_CANARY_DIED.md new file mode 100644 index 0000000..f72f3e1 --- /dev/null +++ b/.github/NIGHTLY_CANARY_DIED.md @@ -0,0 +1,8 @@ +--- +title: "Tests fail on latest Nargo nightly release" +assignees: TomAFrench +--- + +The tests on this Noir project have started failing when using the latest nightly release of the Noir compiler. This likely means that there have been breaking changes for which this project needs to be updated to take into account. + +Check the [{{env.WORKFLOW_NAME}}]({{env.WORKFLOW_URL}}) workflow for details. \ No newline at end of file diff --git a/.github/workflows/nightly-canary.yml b/.github/workflows/nightly-canary.yml new file mode 100644 index 0000000..ddacb4d --- /dev/null +++ b/.github/workflows/nightly-canary.yml @@ -0,0 +1,40 @@ +name: Noir Nightly Canary + +on: + schedule: + # Run a check at 9 AM UTC + - cron: "0 9 * * *" + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Test on Nargo ${{matrix.toolchain}} + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install Nargo + uses: noir-lang/noirup@v0.1.3 + with: + toolchain: nightly + + - name: Run Noir tests + run: nargo test + + - name: Run formatter + run: nargo fmt --check + + - name: Alert on dead links + uses: JasonEtco/create-an-issue@v2 + if: ${{ failure() }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WORKFLOW_NAME: ${{ github.workflow }} + WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + with: + update_existing: true + filename: .github/NIGHTLY_CANARY_DIED.md + \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..6ffba86 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,44 @@ +name: Noir tests + +on: + push: + branches: + - main + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Test on Nargo ${{matrix.toolchain}} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + toolchain: [nightly, 0.32.0] + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install Nargo + uses: noir-lang/noirup@v0.1.3 + with: + toolchain: ${{ matrix.toolchain }} + + - name: Run Noir tests + run: nargo test + + format: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install Nargo + uses: noir-lang/noirup@v0.1.3 + with: + toolchain: 0.32.0 + + - name: Run formatter + run: nargo fmt --check From f0d429b0d47c35c416529fe16d1b7fc785198653 Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 3 Sep 2024 13:33:29 +0100 Subject: [PATCH 2/3] . --- .github/workflows/nightly-canary.yml | 3 ++- .github/workflows/test.yml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly-canary.yml b/.github/workflows/nightly-canary.yml index ddacb4d..1a310fb 100644 --- a/.github/workflows/nightly-canary.yml +++ b/.github/workflows/nightly-canary.yml @@ -25,9 +25,10 @@ jobs: run: nargo test - name: Run formatter + working-directory: ./lib run: nargo fmt --check - - name: Alert on dead links + - name: Alert on dead canary uses: JasonEtco/create-an-issue@v2 if: ${{ failure() }} env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6ffba86..1fc842d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,6 +27,7 @@ jobs: toolchain: ${{ matrix.toolchain }} - name: Run Noir tests + working-directory: ./lib run: nargo test format: @@ -41,4 +42,5 @@ jobs: toolchain: 0.32.0 - name: Run formatter + working-directory: ./lib run: nargo fmt --check From de653fd5e88637a1c019e52c1587a0049989d335 Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 3 Sep 2024 13:34:32 +0100 Subject: [PATCH 3/3] . --- lib/src/rsa.nr | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/src/rsa.nr b/lib/src/rsa.nr index aaabaa3..ca2f520 100644 --- a/lib/src/rsa.nr +++ b/lib/src/rsa.nr @@ -5,7 +5,6 @@ use dep::bignum::runtime_bignum::BigNumInstanceTrait; use crate::types::{RSA, BN1024, BN2048, BNInst1024, BNInst2048, RSA1024, RSA2048}; - /** * @brief Compare a recovered byte hash from an RSA signature to the original message hash * @details Taken from https://github.com/richardliang/noir-rsa @@ -84,7 +83,6 @@ impl RSA where BN: } } - #[test] fn test_verify_sha256_pkcs1v15_1024() { let sha256_hash: [u8; 32] = dep::std::hash::sha256("Hello World! This is Noir-RSA".as_bytes());