From ad7173bfccff36a878178e44f95a2bb969bd580f Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 30 Jan 2025 17:01:19 +0000 Subject: [PATCH 1/6] chore(ci): improve testing coverage --- .github/workflows/ci.yml | 54 +++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 056404f..eb7fd11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,16 +13,45 @@ permissions: env: REPO: ${{ github.event.pull_request.head.repo.full_name || github.repository }} REF: ${{ github.head_ref || github.ref_name }} + MINIMUM_NOIR_VERSION: v0.1.0 jobs: + noir-version-list: + name: Query supported Noir versions + runs-on: ubuntu-latest + outputs: + noir_versions: ${{ steps.get_versions.outputs.versions }} + + steps: + - name: Checkout sources + id: get_versions + run: | + # gh returns the Noir releases in reverse chronological order so we keep all releases published after the minimum supported version. + VERSIONS=$(gh release list -R noir-lang/noir --exclude-pre-releases --json tagName -q 'map(.tagName) | index(env.MINIMUM_NOIR_VERSION) as $index | if $index then .[0:$index+1] else [env.MINIMUM_NOIR_VERSION] end') + echo "versions=$VERSIONS" + echo "versions=$VERSIONS" >> $GITHUB_OUTPUT + env: + GH_TOKEN: ${{ github.token }} + + install: name: Noir ${{matrix.toolchain}} (CLI) on ${{matrix.os == 'ubuntu' && 'Linux' || matrix.os == 'macos' && 'macOS' || matrix.os == 'windows' && 'Windows' || '???'}} + needs: [noir-version-list] runs-on: ${{matrix.os}}-latest strategy: fail-fast: false matrix: os: [ubuntu, macos] - toolchain: [stable, nightly, 0.1.0, 0.1.1, 0.2.0, 0.3.0, 0.4.1] + toolchain: ${{ fromJson( needs.noir-version-list.outputs.noir_versions )}} + include: + - os: ubuntu + toolchain: nightly + - os: ubuntu + toolchain: stable + - os: macos + toolchain: nightly + - os: macos + toolchain: stable timeout-minutes: 45 steps: - name: Parse toolchain @@ -57,10 +86,10 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu, macos] # Installing from source can technically target any commit. # However, we only guarantee that noirup will build release commits. - version: [0.1.0, 0.1.1, 0.2.0, 0.3.0, 0.4.1] + os: [ubuntu, macos] + version: ${{ fromJson( needs.noir-version-list.outputs.noir_versions )}} timeout-minutes: 45 steps: - name: Install noirup @@ -80,14 +109,6 @@ jobs: ~/.cargo/git/db/ key: ${{ runner.os }}-cargo-${{ matrix.version }} - - name: Install Barretenberg dependencies - if: matrix.os == 'ubuntu' - run: sudo apt update && sudo apt install clang lld cmake libomp-dev - - - name: Install Barretenberg dependencies - if: matrix.os == 'macos' - run: brew install cmake llvm libomp - - name: Install nargo from source with noirup run: noirup $toolchain env: @@ -102,7 +123,16 @@ jobs: fail-fast: false matrix: os: [ubuntu, macos] - toolchain: [stable, nightly, 0.1.0, 0.1.1, 0.2.0, 0.3.0, 0.4.1] + toolchain: ${{ fromJson( needs.noir-version-list.outputs.noir_versions )}} + include: + - os: ubuntu + toolchain: nightly + - os: ubuntu + toolchain: stable + - os: macos + toolchain: nightly + - os: macos + toolchain: stable timeout-minutes: 45 steps: - uses: actions/checkout@v3 From a31b3e132641075a527107531ed14e9bc87b11a9 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 30 Jan 2025 17:02:10 +0000 Subject: [PATCH 2/6] . --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb7fd11..0a8fb1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,6 +82,7 @@ jobs: install-source: name: Noir ${{matrix.version}} (from source) on ${{matrix.os == 'ubuntu' && 'Linux' || matrix.os == 'macos' && 'macOS' || matrix.os == 'windows' && 'Windows' || '???'}} + needs: [noir-version-list] runs-on: ${{matrix.os}}-latest strategy: fail-fast: false @@ -118,6 +119,7 @@ jobs: install-action: name: Noir ${{matrix.toolchain}} (GH action) on ${{matrix.os == 'ubuntu' && 'Linux' || matrix.os == 'macos' && 'macOS' || matrix.os == 'windows' && 'Windows' || '???'}} + needs: [noir-version-list] runs-on: ${{matrix.os}}-latest strategy: fail-fast: false From 4a76adb07b54926a492451592ccc8191b8cc11d4 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 30 Jan 2025 17:07:23 +0000 Subject: [PATCH 3/6] . --- .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 0a8fb1a..6a6d7d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ permissions: env: REPO: ${{ github.event.pull_request.head.repo.full_name || github.repository }} REF: ${{ github.head_ref || github.ref_name }} - MINIMUM_NOIR_VERSION: v0.1.0 + MINIMUM_NOIR_VERSION: v0.3.1 jobs: noir-version-list: From 2d5688251d9a72b43bb01af7574ced5eccab130f Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 30 Jan 2025 17:17:08 +0000 Subject: [PATCH 4/6] . --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a6d7d2..0df3d01 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,7 @@ jobs: - name: Install nargo from source with noirup run: noirup $toolchain env: - toolchain: -b tags/v${{matrix.version}} + toolchain: -b tags/${{matrix.version}} - name: Check nargo installation run: nargo --version @@ -152,10 +152,11 @@ jobs: version=$(nargo --version) version="${version#* }" version="${version%% (*}" + minor=$(echo $version | cut -d '.' -f 1) minor=$(echo $version | cut -d '.' -f 2) # The version in which the compile syntax changed - if [ "$minor" -lt 10 ]; then + if [ "$major" -lt 1 ] & [ "$minor" -lt 10 ]; then nargo compile test-circuit else nargo compile From 0895a03dc4a6e32a846a8f4eaf086aef0965e471 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 30 Jan 2025 17:24:12 +0000 Subject: [PATCH 5/6] . --- .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 0df3d01..67e5a21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -156,7 +156,7 @@ jobs: minor=$(echo $version | cut -d '.' -f 2) # The version in which the compile syntax changed - if [ "$major" -lt 1 ] & [ "$minor" -lt 10 ]; then + if [[ "$major" == 1 && "$minor" -lt 10 ]]; then nargo compile test-circuit else nargo compile From 4af15719ad66816a7a3dc5715191600e132e3f46 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Thu, 30 Jan 2025 17:33:34 +0000 Subject: [PATCH 6/6] chore!: drop support for noir versions pre 0.16.0 --- .github/workflows/ci.yml | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67e5a21..5470aeb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ permissions: env: REPO: ${{ github.event.pull_request.head.repo.full_name || github.repository }} REF: ${{ github.head_ref || github.ref_name }} - MINIMUM_NOIR_VERSION: v0.3.1 + MINIMUM_NOIR_VERSION: v0.16.0 jobs: noir-version-list: @@ -147,23 +147,7 @@ jobs: - run: nargo new project - run: nargo check working-directory: ./project - - run: | - # Extract the minor version number from the version output - version=$(nargo --version) - version="${version#* }" - version="${version%% (*}" - minor=$(echo $version | cut -d '.' -f 1) - minor=$(echo $version | cut -d '.' -f 2) - - # The version in which the compile syntax changed - if [[ "$major" == 1 && "$minor" -lt 10 ]]; then - nargo compile test-circuit - else - nargo compile - fi - name: nargo compile + - run: nargo compile working-directory: ./project - shell: bash - run: nargo test - if: matrix.toolchain != '0.1.0' working-directory: ./project