Skip to content

Commit

Permalink
Merge pull request #7 from noir-lang/tf/setup-ci
Browse files Browse the repository at this point in the history
chore: add CI
  • Loading branch information
TomAFrench authored Sep 3, 2024
2 parents 0e18d18 + de653fd commit a33e116
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/NIGHTLY_CANARY_DIED.md
Original file line number Diff line number Diff line change
@@ -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.
41 changes: 41 additions & 0 deletions .github/workflows/nightly-canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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/[email protected]
with:
toolchain: nightly

- name: Run Noir tests
run: nargo test

- name: Run formatter
working-directory: ./lib
run: nargo fmt --check

- name: Alert on dead canary
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

46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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/[email protected]
with:
toolchain: ${{ matrix.toolchain }}

- name: Run Noir tests
working-directory: ./lib
run: nargo test

format:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install Nargo
uses: noir-lang/[email protected]
with:
toolchain: 0.32.0

- name: Run formatter
working-directory: ./lib
run: nargo fmt --check
2 changes: 0 additions & 2 deletions lib/src/rsa.nr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -84,7 +83,6 @@ impl<BN, BNInstance, let NumBytes: u32> RSA<BN, BNInstance, NumBytes> 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());
Expand Down

0 comments on commit a33e116

Please sign in to comment.