From 05d07c728851a1292a22721eb2d8ee7ca0de74e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Tue, 19 Dec 2023 15:13:21 +0000 Subject: [PATCH] reaching the limits of nektos/act here --- .github/actions/setup/action.yml | 14 +++++------ .github/scripts/latestStable.js | 35 +++++++------------------- .github/workflows/nightly.yaml | 43 +++++++++++++++++++------------- .gitignore | 3 +++ 4 files changed, 45 insertions(+), 50 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index af53672..7b1ddfd 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -24,11 +24,11 @@ runs: run: yarn --immutable shell: bash - - name: Install Nargo - uses: noir-lang/noirup@v0.1.2 - with: - toolchain: ${{ inputs.version }} + # - name: Install Nargo + # uses: noir-lang/noirup@v0.1.2 + # with: + # toolchain: ${{ inputs.version }} - - name: Use Nargo - run: nargo --version - shell: bash + # - name: Use Nargo + # run: nargo --version + # shell: bash diff --git a/.github/scripts/latestStable.js b/.github/scripts/latestStable.js index 79b92e6..44feeda 100644 --- a/.github/scripts/latestStable.js +++ b/.github/scripts/latestStable.js @@ -12,32 +12,15 @@ async function main() { const data = await res.json(); - const latestStable = data - .filter(release => !release.tag_name.includes('aztec')) - .filter(release => !release.prerelease) - .map(release => release.tag_name) - .shift(); - - // const latestNightly = data - // .filter(release => !release.tag_name.includes('aztec')) - // .filter(release => release.prerelease) - // .map(release => release.tag_name) - // .shift(); - - // for (let release of releases) { - // const tagName = release.tag_name; - // const tagRes = await fetch( - // `https://api.github.com/repos/noir-lang/noir/git/ref/tags/${tagName}`, - // fetchOpts, - // ); - // const tagData = await tagRes.json(); - - // // Attach commit SHA to release - // release.commit_sha = tagData.object.sha; - // } - - // const output = JSON.stringify([latestStable]); - console.log(JSON.stringify([latestStable])); // DON'T REMOVE, GITHUB WILL CAPTURE THIS OUTPUT + const filtered = data.filter( + release => !release.tag_name.includes('aztec') && !release.tag_name.includes('nightly'), + ); + + const latestStable = filtered.find(release => !release.prerelease).tag_name; + const latestPreRelease = filtered.find(release => release.prerelease).tag_name; + + const workflowOutput = JSON.stringify({ stable: latestStable, prerelease: latestPreRelease }); + console.log(workflowOutput); // DON'T REMOVE, GITHUB WILL CAPTURE THIS OUTPUT } main(); diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 21dbe80..86a29f6 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -4,9 +4,9 @@ on: push: # paths: # - 'vite-hardhat/**' -# pull_request: -# paths: -# - 'vite-hardhat/**' + pull_request: + paths: + - 'vite-hardhat/**' jobs: setup: @@ -28,7 +28,7 @@ jobs: run: | VERSIONS='${{ steps.versions_step.outputs.versionArray }}' echo "Versions for Matrix: $VERSIONS" - MATRIX=$(echo "$VERSIONS" | jq -c '[.[] | {version: .}]') + MATRIX=$(echo "$VERSIONS" | jq -c '{versions: .} | .versions | to_entries | map({key: .key, value: (.value | sub("^v"; ""))})') echo "::set-output name=matrix::{\"include\":$MATRIX}" test-drift-vite-hardhat: @@ -41,26 +41,29 @@ jobs: matrix: ${{fromJson(needs.setup.outputs.matrix)}} steps: - uses: actions/checkout@v4 + with: + ref: ${{ (matrix.key == 'prerelease' && 'prerelease') || github.base_ref }} + + - name: DEBUGGING + run: echo "${{ matrix.key }}" + - name: DEBUGGING2 + run: echo "${{ github.base_ref }}" + - name: DEBUGGING3 + run: echo "${{ github.head_ref }}" - name: Set up test environment uses: ./.github/actions/setup with: project: vite-hardhat - version: ${{ matrix.version }} - - - name: Generate verifier contract - run: | - nargo codegen-verifier - working-directory: vite-hardhat/circuits + version: ${{ matrix.value }} - name: Install test version run: | yarn add \ - @noir-lang/noir_js@${{ matrix.version }} \ - @noir-lang/backend_barretenberg@${{ matrix.version }} \ - @noir-lang/noir_wasm@${{ matrix.version }} \ - @noir-lang/source-resolver@${{ matrix.version }} \ - @noir-lang/types@${{ matrix.version }} + @noir-lang/noir_js@${{ matrix.value }} \ + @noir-lang/backend_barretenberg@${{ matrix.value }} \ + @noir-lang/noir_wasm@${{ matrix.value }} \ + @noir-lang/types@${{ matrix.value }} - name: 'Create env file' run: | @@ -70,5 +73,11 @@ jobs: echo MUMBAI_ALCHEMY_KEY"=${{ secrets.MUMBAI_ALCHEMY_KEY }}" >> .env echo MUMBAI_DEPLOYER_PRIVATE_KEY="${{ secrets.MUMBAI_DEPLOYER_PRIVATE_KEY }}" >> .env - # - name: Run test - # run: yarn test + # - name: Generate verifier contract + # run: | + # nargo codegen-verifier + # working-directory: vite-hardhat/circuits + + - name: Run test + run: yarn test + continue-on-error: ${{ matrix.key != 'prerelease' }} diff --git a/.gitignore b/.gitignore index 0028c9f..972f3b5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ node_modules package-lock.json + +# To use with nektos/act +.github/event.json