From bc2399717d89b2c40ff9cc45f317f0a74f5f3dbb Mon Sep 17 00:00:00 2001 From: Khashayar Barooti Date: Mon, 20 Jan 2025 16:56:08 +0000 Subject: [PATCH] added automated workflow --- .github/workflows/test.yml | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 56df927..f906a6e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,15 +8,36 @@ on: env: CARGO_TERM_COLOR: always + MINIMUM_NOIR_VERSION: v0.36.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 }} + test: + needs: [noir-version-list] name: Test on Nargo ${{matrix.toolchain}} runs-on: ubuntu-latest strategy: fail-fast: false matrix: - toolchain: [nightly, 0.36.0] + toolchain: ${{ fromJson( needs.noir-version-list.outputs.noir_versions )}} + include: + - toolchain: nightly steps: - name: Checkout sources uses: actions/checkout@v4 @@ -38,7 +59,7 @@ jobs: - name: Install Nargo uses: noir-lang/noirup@v0.1.3 with: - toolchain: 0.36.0 + toolchain: ${{ env.MINIMUM_NOIR_VERSION }} - name: Run formatter run: nargo fmt --check @@ -53,7 +74,7 @@ jobs: needs: - test - format - + steps: - name: Report overall success run: | @@ -64,4 +85,4 @@ jobs: 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') }} + FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} \ No newline at end of file