From 740ccb82a382c81adef42e4b64240c1960627989 Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 24 Oct 2023 19:40:01 +0100 Subject: [PATCH 01/14] chore(ci): use nix caching where possible in CI --- .github/workflows/auto-pr-rebuild-script.yml | 26 ++++++++++---------- .github/workflows/gates_report.yml | 26 ++++++++++---------- .github/workflows/test-integration.yml | 26 ++++++++++---------- .github/workflows/test-noir_wasm.yml | 26 ++++++++++---------- 4 files changed, 52 insertions(+), 52 deletions(-) diff --git a/.github/workflows/auto-pr-rebuild-script.yml b/.github/workflows/auto-pr-rebuild-script.yml index 5e46e46ed4c..b4ee5a377cf 100644 --- a/.github/workflows/auto-pr-rebuild-script.yml +++ b/.github/workflows/auto-pr-rebuild-script.yml @@ -16,29 +16,29 @@ jobs: - name: Checkout Noir repo uses: actions/checkout@v4 - - name: Setup toolchain - uses: dtolnay/rust-toolchain@1.66.0 + - name: Setup Nix + uses: cachix/install-nix-action@v22 + with: + nix_path: nixpkgs=channel:nixos-23.05 + github_access_token: ${{ secrets.GITHUB_TOKEN }} - - uses: Swatinem/rust-cache@v2 + - uses: cachix/cachix-action@v12 with: - key: ${{ matrix.target }} - cache-on-failure: true - save-if: ${{ github.event_name != 'merge_group' }} + name: barretenberg + authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - name: Build Nargo - run: cargo build --package nargo_cli --release - - - name: Package artifacts run: | - mkdir dist - cp ./target/release/nargo ./dist/nargo - 7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz + nix build -L . + + - name: Dereference symlink + run: echo "UPLOAD_PATH=$(readlink -f ./result/bin/nargo)" >> $GITHUB_ENV - name: Upload artifact uses: actions/upload-artifact@v3 with: name: nargo - path: ./dist/* + path: ${{ env.UPLOAD_PATH }} retention-days: 3 auto-pr-rebuild-script: diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index e2d6bdd56b7..c38140503aa 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -17,29 +17,29 @@ jobs: - name: Checkout Noir repo uses: actions/checkout@v4 - - name: Setup toolchain - uses: dtolnay/rust-toolchain@1.66.0 + - name: Setup Nix + uses: cachix/install-nix-action@v22 + with: + nix_path: nixpkgs=channel:nixos-23.05 + github_access_token: ${{ secrets.GITHUB_TOKEN }} - - uses: Swatinem/rust-cache@v2 + - uses: cachix/cachix-action@v12 with: - key: ${{ matrix.target }} - cache-on-failure: true - save-if: ${{ github.event_name != 'merge_group' }} + name: barretenberg + authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - name: Build Nargo - run: cargo build --package nargo_cli --release - - - name: Package artifacts run: | - mkdir dist - cp ./target/release/nargo ./dist/nargo - 7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz + nix build -L . + + - name: Dereference symlink + run: echo "UPLOAD_PATH=$(readlink -f ./result/bin/nargo)" >> $GITHUB_ENV - name: Upload artifact uses: actions/upload-artifact@v3 with: name: nargo - path: ./dist/* + path: ${{ env.UPLOAD_PATH }} retention-days: 3 diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index f3bb953f676..917f7921071 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -18,29 +18,29 @@ jobs: - name: Checkout Noir repo uses: actions/checkout@v4 - - name: Setup toolchain - uses: dtolnay/rust-toolchain@1.66.0 + - name: Setup Nix + uses: cachix/install-nix-action@v22 + with: + nix_path: nixpkgs=channel:nixos-23.05 + github_access_token: ${{ secrets.GITHUB_TOKEN }} - - uses: Swatinem/rust-cache@v2 + - uses: cachix/cachix-action@v12 with: - key: ${{ matrix.target }} - cache-on-failure: true - save-if: ${{ github.event_name != 'merge_group' }} + name: barretenberg + authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - name: Build Nargo - run: cargo build --package nargo_cli --release - - - name: Package artifacts run: | - mkdir dist - cp ./target/release/nargo ./dist/nargo - 7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz + nix build -L . + + - name: Dereference symlink + run: echo "UPLOAD_PATH=$(readlink -f ./result/bin/nargo)" >> $GITHUB_ENV - name: Upload artifact uses: actions/upload-artifact@v3 with: name: nargo - path: ./dist/* + path: ${{ env.UPLOAD_PATH }} retention-days: 3 build-wasm: diff --git a/.github/workflows/test-noir_wasm.yml b/.github/workflows/test-noir_wasm.yml index eea4074e00a..a37e518cae2 100644 --- a/.github/workflows/test-noir_wasm.yml +++ b/.github/workflows/test-noir_wasm.yml @@ -22,29 +22,29 @@ jobs: - name: Checkout Noir repo uses: actions/checkout@v4 - - name: Setup toolchain - uses: dtolnay/rust-toolchain@1.66.0 + - name: Setup Nix + uses: cachix/install-nix-action@v22 + with: + nix_path: nixpkgs=channel:nixos-23.05 + github_access_token: ${{ secrets.GITHUB_TOKEN }} - - uses: Swatinem/rust-cache@v2 + - uses: cachix/cachix-action@v12 with: - key: ${{ matrix.target }} - cache-on-failure: true - save-if: ${{ github.event_name != 'merge_group' }} + name: barretenberg + authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - name: Build Nargo - run: cargo build --package nargo_cli --release - - - name: Package artifacts run: | - mkdir dist - cp ./target/release/nargo ./dist/nargo - 7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz + nix build -L . + + - name: Dereference symlink + run: echo "UPLOAD_PATH=$(readlink -f ./result/bin/nargo)" >> $GITHUB_ENV - name: Upload artifact uses: actions/upload-artifact@v3 with: name: nargo - path: ./dist/* + path: ${{ env.UPLOAD_PATH }} retention-days: 3 build-wasm: From 67ae1a3719af4592d6c5a8ebfc671194c6d6951f Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 24 Oct 2023 19:57:39 +0100 Subject: [PATCH 02/14] chore: use custom nix github action --- .github/workflows/auto-pr-rebuild-script.yml | 12 +++---- .github/workflows/gates_report.yml | 12 +++---- .github/workflows/publish-es-packages.yml | 6 ++-- .github/workflows/test-abi_wasm.yml | 12 +++---- .github/workflows/test-acvm-js.yml | 13 +++---- .github/workflows/test-integration.yml | 36 +++++++------------- .github/workflows/test-noir_wasm.yml | 24 +++++-------- cspell.json | 1 + 8 files changed, 41 insertions(+), 75 deletions(-) diff --git a/.github/workflows/auto-pr-rebuild-script.yml b/.github/workflows/auto-pr-rebuild-script.yml index b4ee5a377cf..8e927eebc6d 100644 --- a/.github/workflows/auto-pr-rebuild-script.yml +++ b/.github/workflows/auto-pr-rebuild-script.yml @@ -17,15 +17,11 @@ jobs: uses: actions/checkout@v4 - name: Setup Nix - uses: cachix/install-nix-action@v22 + uses: ./.github/actions/nix with: - nix_path: nixpkgs=channel:nixos-23.05 - github_access_token: ${{ secrets.GITHUB_TOKEN }} - - - uses: cachix/cachix-action@v12 - with: - name: barretenberg - authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" + github-token: ${{ secrets.GITHUB_TOKEN }} + nix-cache-name: barretenberg + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Build Nargo run: | diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index c38140503aa..9386ba48a7c 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -18,15 +18,11 @@ jobs: uses: actions/checkout@v4 - name: Setup Nix - uses: cachix/install-nix-action@v22 + uses: ./.github/actions/nix with: - nix_path: nixpkgs=channel:nixos-23.05 - github_access_token: ${{ secrets.GITHUB_TOKEN }} - - - uses: cachix/cachix-action@v12 - with: - name: barretenberg - authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" + github-token: ${{ secrets.GITHUB_TOKEN }} + nix-cache-name: barretenberg + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Build Nargo run: | diff --git a/.github/workflows/publish-es-packages.yml b/.github/workflows/publish-es-packages.yml index 14630434453..3511eb5c49e 100644 --- a/.github/workflows/publish-es-packages.yml +++ b/.github/workflows/publish-es-packages.yml @@ -28,7 +28,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} nix-cache-name: ${{ vars.NIX_CACHE_NAME }} - cachix-auth-token: ${{ secrets.CACHIXAUTHTOKEN }} + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Enable aztec features if: ${{ inputs.npm-tag == 'aztec' }} @@ -59,7 +59,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} nix-cache-name: ${{ vars.NIX_CACHE_NAME }} - cachix-auth-token: ${{ secrets.CACHIXAUTHTOKEN }} + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Build wasm package run: | @@ -85,7 +85,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} nix-cache-name: ${{ vars.NIX_CACHE_NAME }} - cachix-auth-token: ${{ secrets.CACHIXAUTHTOKEN }} + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Build wasm package run: | diff --git a/.github/workflows/test-abi_wasm.yml b/.github/workflows/test-abi_wasm.yml index 7fecb66fd7f..f6a620f8787 100644 --- a/.github/workflows/test-abi_wasm.yml +++ b/.github/workflows/test-abi_wasm.yml @@ -23,15 +23,11 @@ jobs: uses: actions/checkout@v3 - name: Setup Nix - uses: cachix/install-nix-action@v22 + uses: ./.github/actions/nix with: - nix_path: nixpkgs=channel:nixos-23.05 - github_access_token: ${{ secrets.GITHUB_TOKEN }} - - - uses: cachix/cachix-action@v12 - with: - name: barretenberg - authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" + github-token: ${{ secrets.GITHUB_TOKEN }} + nix-cache-name: barretenberg + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Build noirc_abi_wasm run: | diff --git a/.github/workflows/test-acvm-js.yml b/.github/workflows/test-acvm-js.yml index 8a469f6ff1e..92e4b2a6c51 100644 --- a/.github/workflows/test-acvm-js.yml +++ b/.github/workflows/test-acvm-js.yml @@ -14,15 +14,12 @@ jobs: - name: Checkout sources uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v20 + - name: Setup Nix + uses: ./.github/actions/nix with: - nix_path: nixpkgs=channel:nixos-22.11 - github_access_token: ${{ secrets.GITHUB_TOKEN }} - - - uses: cachix/cachix-action@v12 - with: - name: barretenberg - authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" + github-token: ${{ secrets.GITHUB_TOKEN }} + nix-cache-name: barretenberg + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Build acvm-js run: | diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 917f7921071..b5b8d654186 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -19,15 +19,11 @@ jobs: uses: actions/checkout@v4 - name: Setup Nix - uses: cachix/install-nix-action@v22 + uses: ./.github/actions/nix with: - nix_path: nixpkgs=channel:nixos-23.05 - github_access_token: ${{ secrets.GITHUB_TOKEN }} - - - uses: cachix/cachix-action@v12 - with: - name: barretenberg - authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" + github-token: ${{ secrets.GITHUB_TOKEN }} + nix-cache-name: barretenberg + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Build Nargo run: | @@ -53,15 +49,11 @@ jobs: uses: actions/checkout@v4 - name: Setup Nix - uses: cachix/install-nix-action@v22 - with: - nix_path: nixpkgs=channel:nixos-23.05 - github_access_token: ${{ secrets.GITHUB_TOKEN }} - - - uses: cachix/cachix-action@v12 + uses: ./.github/actions/nix with: - name: barretenberg - authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" + github-token: ${{ secrets.GITHUB_TOKEN }} + nix-cache-name: barretenberg + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Build wasm package run: | @@ -99,15 +91,11 @@ jobs: uses: actions/checkout@v3 - name: Setup Nix - uses: cachix/install-nix-action@v22 - with: - nix_path: nixpkgs=channel:nixos-23.05 - github_access_token: ${{ secrets.GITHUB_TOKEN }} - - - uses: cachix/cachix-action@v12 + uses: ./.github/actions/nix with: - name: barretenberg - authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" + github-token: ${{ secrets.GITHUB_TOKEN }} + nix-cache-name: barretenberg + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Restore nix store cache uses: actions/cache/restore@v3 diff --git a/.github/workflows/test-noir_wasm.yml b/.github/workflows/test-noir_wasm.yml index a37e518cae2..58eaa09f7ab 100644 --- a/.github/workflows/test-noir_wasm.yml +++ b/.github/workflows/test-noir_wasm.yml @@ -23,15 +23,11 @@ jobs: uses: actions/checkout@v4 - name: Setup Nix - uses: cachix/install-nix-action@v22 + uses: ./.github/actions/nix with: - nix_path: nixpkgs=channel:nixos-23.05 - github_access_token: ${{ secrets.GITHUB_TOKEN }} - - - uses: cachix/cachix-action@v12 - with: - name: barretenberg - authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" + github-token: ${{ secrets.GITHUB_TOKEN }} + nix-cache-name: barretenberg + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Build Nargo run: | @@ -57,15 +53,11 @@ jobs: uses: actions/checkout@v4 - name: Setup Nix - uses: cachix/install-nix-action@v22 - with: - nix_path: nixpkgs=channel:nixos-23.05 - github_access_token: ${{ secrets.GITHUB_TOKEN }} - - - uses: cachix/cachix-action@v12 + uses: ./.github/actions/nix with: - name: barretenberg - authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" + github-token: ${{ secrets.GITHUB_TOKEN }} + nix-cache-name: barretenberg + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Build wasm package run: | diff --git a/cspell.json b/cspell.json index 4df858ffcfa..9c5de0c8d40 100644 --- a/cspell.json +++ b/cspell.json @@ -15,6 +15,7 @@ "bitand", "blackbox", "brillig", + "cachix", "callsite", "callsites", "canonicalize", From 6fc3960ac759b811857905c8fcc23151a6877e49 Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 24 Oct 2023 20:06:53 +0100 Subject: [PATCH 03/14] chore: clean up bad caches --- .github/workflows/test-abi_wasm.yml | 2 -- .github/workflows/test-integration.yml | 47 -------------------------- .github/workflows/test-noir_wasm.yml | 2 -- 3 files changed, 51 deletions(-) diff --git a/.github/workflows/test-abi_wasm.yml b/.github/workflows/test-abi_wasm.yml index f6a620f8787..ffcc747c5f5 100644 --- a/.github/workflows/test-abi_wasm.yml +++ b/.github/workflows/test-abi_wasm.yml @@ -15,8 +15,6 @@ concurrency: jobs: build: runs-on: ubuntu-latest - env: - CACHED_PATH: /tmp/nix-cache steps: - name: Checkout sources diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index b5b8d654186..2482d46f986 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -41,8 +41,6 @@ jobs: build-wasm: runs-on: ubuntu-latest - env: - CACHED_PATH: /tmp/nix-cache steps: - name: Checkout sources @@ -59,18 +57,6 @@ jobs: run: | nix build -L .#noir_wasm - - name: Export cache from nix store - if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }} - run: | - nix copy --to "file://${{ env.CACHED_PATH }}?compression=zstd¶llel-compression=true" .#noir-wasm-cargo-artifacts - - - uses: actions/cache/save@v3 - # Don't create cache entries for the merge queue. - if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }} - with: - path: ${{ env.CACHED_PATH }} - key: ${{ steps.cache.outputs.cache-primary-key }} - - name: Dereference symlink run: echo "UPLOAD_PATH=$(readlink -f ./result/noir_wasm)" >> $GITHUB_ENV @@ -83,8 +69,6 @@ jobs: build-noirc: runs-on: ubuntu-latest - env: - CACHED_PATH: /tmp/nix-cache steps: - name: Checkout sources @@ -97,41 +81,12 @@ jobs: nix-cache-name: barretenberg cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - - name: Restore nix store cache - uses: actions/cache/restore@v3 - id: cache - with: - path: ${{ env.CACHED_PATH }} - key: ${{ runner.os }}-flake-abi-wasm-${{ hashFiles('*.lock') }} - - # Based on https://github.com/marigold-dev/deku/blob/b5016f0cf4bf6ac48db9111b70dd7fb49b969dfd/.github/workflows/build.yml#L26 - - name: Copy cache into nix store - if: steps.cache.outputs.cache-hit == 'true' - # We don't check the signature because we're the one that created the cache - run: | - for narinfo in ${{ env.CACHED_PATH }}/*.narinfo; do - path=$(head -n 1 "$narinfo" | awk '{print $2}') - nix copy --no-check-sigs --from "file://${{ env.CACHED_PATH }}" "$path" - done - - name: Build noirc_abi_wasm run: | nix build -L .#noirc_abi_wasm cp -r ./result/noirc_abi_wasm/nodejs ./tooling/noirc_abi_wasm cp -r ./result/noirc_abi_wasm/web ./tooling/noirc_abi_wasm - - name: Export cache from nix store - if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }} - run: | - nix copy --to "file://${{ env.CACHED_PATH }}?compression=zstd¶llel-compression=true" .#noirc-abi-wasm-cargo-artifacts - - - uses: actions/cache/save@v3 - # Don't create cache entries for the merge queue. - if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }} - with: - path: ${{ env.CACHED_PATH }} - key: ${{ steps.cache.outputs.cache-primary-key }} - - name: Dereference symlink run: echo "UPLOAD_PATH=$(readlink -f ./result/noirc_abi_wasm)" >> $GITHUB_ENV @@ -145,8 +100,6 @@ jobs: test-solidity-verifier: runs-on: ubuntu-latest needs: [build-wasm, build-nargo, build-noirc] - env: - CACHED_PATH: /tmp/nix-cache steps: - name: Checkout diff --git a/.github/workflows/test-noir_wasm.yml b/.github/workflows/test-noir_wasm.yml index 58eaa09f7ab..6e71e4488bb 100644 --- a/.github/workflows/test-noir_wasm.yml +++ b/.github/workflows/test-noir_wasm.yml @@ -45,8 +45,6 @@ jobs: build-wasm: runs-on: ubuntu-latest - env: - CACHED_PATH: /tmp/nix-cache steps: - name: Checkout sources From ed9b8234c94861342e4bac6bbfd723f6b656a1df Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 24 Oct 2023 20:21:17 +0100 Subject: [PATCH 04/14] chore: update path to nargo binary --- .github/workflows/gates_report.yml | 8 ++++---- .github/workflows/test-integration.yml | 7 +++---- .github/workflows/test-noir_wasm.yml | 11 ++++++++--- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index 9386ba48a7c..2cbe9c86b83 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -58,12 +58,12 @@ jobs: - name: Set nargo on PATH run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" - chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" + chmod +x ./nargo/nargo + echo "./nargo" >> $GITHUB_PATH + export PATH="$PATH:./nargo" nargo -V + - name: Generate gates report working-directory: ./tooling/nargo_cli/tests run: | diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 2482d46f986..d77e3ce59e3 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -125,10 +125,9 @@ jobs: - name: Set nargo on PATH run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" - chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" + chmod +x ./nargo/nargo + echo "./nargo" >> $GITHUB_PATH + export PATH="$PATH:./nargo" nargo -V - name: Install Yarn dependencies diff --git a/.github/workflows/test-noir_wasm.yml b/.github/workflows/test-noir_wasm.yml index 6e71e4488bb..7d058f0fd78 100644 --- a/.github/workflows/test-noir_wasm.yml +++ b/.github/workflows/test-noir_wasm.yml @@ -91,14 +91,19 @@ jobs: name: nargo path: ./nargo + - name: Set nargo on PATH + run: | + chmod +x ./nargo/nargo + echo "./nargo" >> $GITHUB_PATH + export PATH="$PATH:./nargo" + nargo -V + - name: Compile fixtures with Nargo CLI working-directory: ./compiler/wasm/fixtures run: | - nargo_binary=${{ github.workspace }}/nargo/nargo - chmod +x $nargo_binary for dir in $(ls -d */); do pushd $dir/noir-script - $nargo_binary compile + nargo compile popd done From eb75cd6bcd7020a2aa71ec99acc97c6c1cc5ee26 Mon Sep 17 00:00:00 2001 From: Tom French Date: Wed, 25 Oct 2023 10:43:22 +0100 Subject: [PATCH 05/14] chore: try zipping artifact --- .github/workflows/auto-pr-rebuild-script.yml | 9 ++++++--- .github/workflows/gates_report.yml | 17 ++++++++++------- .github/workflows/test-integration.yml | 17 ++++++++++------- .github/workflows/test-noir_wasm.yml | 17 ++++++++++------- 4 files changed, 36 insertions(+), 24 deletions(-) diff --git a/.github/workflows/auto-pr-rebuild-script.yml b/.github/workflows/auto-pr-rebuild-script.yml index 8e927eebc6d..b85fc1ec53e 100644 --- a/.github/workflows/auto-pr-rebuild-script.yml +++ b/.github/workflows/auto-pr-rebuild-script.yml @@ -27,14 +27,17 @@ jobs: run: | nix build -L . - - name: Dereference symlink - run: echo "UPLOAD_PATH=$(readlink -f ./result/bin/nargo)" >> $GITHUB_ENV + - name: Package artifacts + run: | + mkdir dist + cp ./result/bin/nargo ./dist/nargo + 7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz - name: Upload artifact uses: actions/upload-artifact@v3 with: name: nargo - path: ${{ env.UPLOAD_PATH }} + path: ./dist/* retention-days: 3 auto-pr-rebuild-script: diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index 2cbe9c86b83..bda9daa03f4 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -28,14 +28,17 @@ jobs: run: | nix build -L . - - name: Dereference symlink - run: echo "UPLOAD_PATH=$(readlink -f ./result/bin/nargo)" >> $GITHUB_ENV + - name: Package artifacts + run: | + mkdir dist + cp ./result/bin/nargo ./dist/nargo + 7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz - name: Upload artifact uses: actions/upload-artifact@v3 with: name: nargo - path: ${{ env.UPLOAD_PATH }} + path: ./dist/* retention-days: 3 @@ -58,12 +61,12 @@ jobs: - name: Set nargo on PATH run: | - chmod +x ./nargo/nargo - echo "./nargo" >> $GITHUB_PATH - export PATH="$PATH:./nargo" + nargo_binary="${{ github.workspace }}/nargo/nargo" + chmod +x $nargo_binary + echo "$(dirname $nargo_binary)" >> $GITHUB_PATH + export PATH="$PATH:$(dirname $nargo_binary)" nargo -V - - name: Generate gates report working-directory: ./tooling/nargo_cli/tests run: | diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index d77e3ce59e3..4078e2f7228 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -29,14 +29,17 @@ jobs: run: | nix build -L . - - name: Dereference symlink - run: echo "UPLOAD_PATH=$(readlink -f ./result/bin/nargo)" >> $GITHUB_ENV + - name: Package artifacts + run: | + mkdir dist + cp ./result/bin/nargo ./dist/nargo + 7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz - name: Upload artifact uses: actions/upload-artifact@v3 with: name: nargo - path: ${{ env.UPLOAD_PATH }} + path: ./dist/* retention-days: 3 build-wasm: @@ -125,10 +128,10 @@ jobs: - name: Set nargo on PATH run: | - chmod +x ./nargo/nargo - echo "./nargo" >> $GITHUB_PATH - export PATH="$PATH:./nargo" - nargo -V + nargo_binary="${{ github.workspace }}/nargo/nargo" + chmod +x $nargo_binary + echo "$(dirname $nargo_binary)" >> $GITHUB_PATH + export PATH="$PATH:$(dirname $nargo_binary)" - name: Install Yarn dependencies uses: ./.github/actions/setup diff --git a/.github/workflows/test-noir_wasm.yml b/.github/workflows/test-noir_wasm.yml index 7d058f0fd78..43545ccc9a6 100644 --- a/.github/workflows/test-noir_wasm.yml +++ b/.github/workflows/test-noir_wasm.yml @@ -33,14 +33,17 @@ jobs: run: | nix build -L . - - name: Dereference symlink - run: echo "UPLOAD_PATH=$(readlink -f ./result/bin/nargo)" >> $GITHUB_ENV + - name: Package artifacts + run: | + mkdir dist + cp ./result/bin/nargo ./dist/nargo + 7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz - name: Upload artifact uses: actions/upload-artifact@v3 with: name: nargo - path: ${{ env.UPLOAD_PATH }} + path: ./dist/* retention-days: 3 build-wasm: @@ -93,10 +96,10 @@ jobs: - name: Set nargo on PATH run: | - chmod +x ./nargo/nargo - echo "./nargo" >> $GITHUB_PATH - export PATH="$PATH:./nargo" - nargo -V + nargo_binary="${{ github.workspace }}/nargo/nargo" + chmod +x $nargo_binary + echo "$(dirname $nargo_binary)" >> $GITHUB_PATH + export PATH="$PATH:$(dirname $nargo_binary)" - name: Compile fixtures with Nargo CLI working-directory: ./compiler/wasm/fixtures From a3e2744a5682b6bf400f431218f142248e28c9a4 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 25 Oct 2023 12:56:49 +0000 Subject: [PATCH 06/14] temp --- .github/workflows/gates_report.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index bda9daa03f4..2c01549aa8e 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -61,11 +61,19 @@ jobs: - name: Set nargo on PATH run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" + tree "${{ github.workspace }}/nargo" + cp "${{ github.workspace }}/nargo/nargo" ./nargo_bin + rm -rf ./nargo + mv ./nargo_bin ./nargo + nargo_binary="${{ github.workspace }}/nargo" chmod +x $nargo_binary echo "$(dirname $nargo_binary)" >> $GITHUB_PATH export PATH="$PATH:$(dirname $nargo_binary)" - nargo -V + echo $PATH + echo $GITHUB_PATH + echo $nargo_binary + echo $(which nargo) + nargo --version - name: Generate gates report working-directory: ./tooling/nargo_cli/tests From 6ca511d0e86b8de722cb210df6dbdb203bb39dd3 Mon Sep 17 00:00:00 2001 From: Tom French Date: Mon, 30 Oct 2023 15:32:03 +0000 Subject: [PATCH 07/14] temp --- .github/workflows/gates_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index 2c01549aa8e..ffabf62ab5c 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -73,7 +73,7 @@ jobs: echo $GITHUB_PATH echo $nargo_binary echo $(which nargo) - nargo --version + $nargo_binary --version - name: Generate gates report working-directory: ./tooling/nargo_cli/tests From 4a26eb166161b02822b74082399dfdbf1a1085db Mon Sep 17 00:00:00 2001 From: Tom French Date: Mon, 30 Oct 2023 16:19:04 +0000 Subject: [PATCH 08/14] chore: extract nargo binary --- .github/workflows/gates_report.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index ffabf62ab5c..97e4e86e128 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -37,7 +37,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v3 with: - name: nargo + name: nargo-x86_64-unknown-linux-gnu.tar.gz path: ./dist/* retention-days: 3 @@ -57,23 +57,20 @@ jobs: uses: actions/download-artifact@v3 with: name: nargo - path: ./nargo + path: ./nargo_bin - name: Set nargo on PATH run: | - tree "${{ github.workspace }}/nargo" - cp "${{ github.workspace }}/nargo/nargo" ./nargo_bin - rm -rf ./nargo - mv ./nargo_bin ./nargo - nargo_binary="${{ github.workspace }}/nargo" + tree "${{ github.workspace }}/nargo_bin/nargo-x86_64-unknown-linux-gnu.tar.gz" + 7z e "${{ github.workspace }}/nargo_bin/nargo-x86_64-unknown-linux-gnu.tar.gz" + tree "${{ github.workspace }}/nargo_bin" + + nargo_binary="${{ github.workspace }}/nargo_bin/nargo" chmod +x $nargo_binary echo "$(dirname $nargo_binary)" >> $GITHUB_PATH export PATH="$PATH:$(dirname $nargo_binary)" - echo $PATH - echo $GITHUB_PATH - echo $nargo_binary echo $(which nargo) - $nargo_binary --version + nargo --version - name: Generate gates report working-directory: ./tooling/nargo_cli/tests From d06a44db4afce583456353a6c14f0ed83b2253f0 Mon Sep 17 00:00:00 2001 From: Tom French Date: Mon, 30 Oct 2023 16:37:01 +0000 Subject: [PATCH 09/14] chore: fix artifact name --- .github/workflows/gates_report.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index 97e4e86e128..e5711ee9402 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -56,12 +56,12 @@ jobs: - name: Download nargo binary uses: actions/download-artifact@v3 with: - name: nargo + name: nargo-x86_64-unknown-linux-gnu.tar.gz path: ./nargo_bin - name: Set nargo on PATH run: | - tree "${{ github.workspace }}/nargo_bin/nargo-x86_64-unknown-linux-gnu.tar.gz" + tree "${{ github.workspace }}/nargo_bin" 7z e "${{ github.workspace }}/nargo_bin/nargo-x86_64-unknown-linux-gnu.tar.gz" tree "${{ github.workspace }}/nargo_bin" From 5c8cc6df958b27d2f3c8971d3048a5174451a117 Mon Sep 17 00:00:00 2001 From: Tom French Date: Mon, 30 Oct 2023 17:18:07 +0000 Subject: [PATCH 10/14] chore: fix --- .github/workflows/gates_report.yml | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index e5711ee9402..7a131efe29b 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -28,17 +28,11 @@ jobs: run: | nix build -L . - - name: Package artifacts - run: | - mkdir dist - cp ./result/bin/nargo ./dist/nargo - 7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz - - name: Upload artifact uses: actions/upload-artifact@v3 with: - name: nargo-x86_64-unknown-linux-gnu.tar.gz - path: ./dist/* + name: nargo.zip + path: ./result/bin/nargo retention-days: 3 @@ -56,21 +50,22 @@ jobs: - name: Download nargo binary uses: actions/download-artifact@v3 with: - name: nargo-x86_64-unknown-linux-gnu.tar.gz - path: ./nargo_bin + name: nargo.zip + path: ./ - name: Set nargo on PATH run: | - tree "${{ github.workspace }}/nargo_bin" - 7z e "${{ github.workspace }}/nargo_bin/nargo-x86_64-unknown-linux-gnu.tar.gz" - tree "${{ github.workspace }}/nargo_bin" - - nargo_binary="${{ github.workspace }}/nargo_bin/nargo" + ls -l . + 7z e ./nargo.zip + ls -l . + + nargo_binary="${{ github.workspace }}/nargo" chmod +x $nargo_binary echo "$(dirname $nargo_binary)" >> $GITHUB_PATH export PATH="$PATH:$(dirname $nargo_binary)" echo $(which nargo) - nargo --version + + $nargo_binary --version - name: Generate gates report working-directory: ./tooling/nargo_cli/tests From b684bc6ffc188f79b2ea35af99095f1a78706af5 Mon Sep 17 00:00:00 2001 From: Tom French Date: Mon, 30 Oct 2023 17:34:18 +0000 Subject: [PATCH 11/14] chore: rename artifact --- .github/workflows/gates_report.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index 7a131efe29b..cd07d1cfb48 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -31,7 +31,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v3 with: - name: nargo.zip + name: nargo-x86_64-unknown-linux-gnu path: ./result/bin/nargo retention-days: 3 @@ -50,13 +50,13 @@ jobs: - name: Download nargo binary uses: actions/download-artifact@v3 with: - name: nargo.zip + name: nargo-x86_64-unknown-linux-gnu path: ./ - name: Set nargo on PATH run: | ls -l . - 7z e ./nargo.zip + 7z e ./nargo-x86_64-unknown-linux-gnu ls -l . nargo_binary="${{ github.workspace }}/nargo" From 72e20de5254bf9f766685546bedcfbe798c161aa Mon Sep 17 00:00:00 2001 From: Tom French Date: Mon, 30 Oct 2023 17:37:27 +0000 Subject: [PATCH 12/14] chore: comment out stuff --- .github/workflows/gates_report.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index cd07d1cfb48..806040bfad3 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -56,8 +56,8 @@ jobs: - name: Set nargo on PATH run: | ls -l . - 7z e ./nargo-x86_64-unknown-linux-gnu - ls -l . + # 7z e ./nargo-x86_64-unknown-linux-gnu + # ls -l . nargo_binary="${{ github.workspace }}/nargo" chmod +x $nargo_binary From ef21f0b70523af8ae49143a2d60aa5ed8c130f36 Mon Sep 17 00:00:00 2001 From: Tom French Date: Mon, 30 Oct 2023 17:51:31 +0000 Subject: [PATCH 13/14] . --- .github/workflows/gates_report.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index 806040bfad3..807f3941e9f 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -51,18 +51,19 @@ jobs: uses: actions/download-artifact@v3 with: name: nargo-x86_64-unknown-linux-gnu - path: ./ + path: ./nargo_bin - name: Set nargo on PATH run: | ls -l . - # 7z e ./nargo-x86_64-unknown-linux-gnu - # ls -l . - nargo_binary="${{ github.workspace }}/nargo" + nargo_bin_dir="./nargo_bin" + nargo_binary="$nargo_bin_dir/nargo" chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" + ls -l $nargo_bin_dir + + echo "$nargo_bin_dir" >> $GITHUB_PATH + export PATH="$PATH:$nargo_bin_dir" echo $(which nargo) $nargo_binary --version From d35d6f825f7d5ac1a6331aa059a00f940f3171e1 Mon Sep 17 00:00:00 2001 From: Tom French Date: Mon, 30 Oct 2023 18:17:58 +0000 Subject: [PATCH 14/14] chore: dereference symlink --- .github/workflows/gates_report.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index 807f3941e9f..9c2b45e716a 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -28,11 +28,14 @@ jobs: run: | nix build -L . + - name: Dereference symlink + run: echo "UPLOAD_PATH=$(readlink -f ./result/bin/nargo)" >> $GITHUB_ENV + - name: Upload artifact uses: actions/upload-artifact@v3 with: name: nargo-x86_64-unknown-linux-gnu - path: ./result/bin/nargo + path: ${{ env.UPLOAD_PATH }} retention-days: 3 @@ -44,8 +47,6 @@ jobs: steps: - uses: actions/checkout@v3 - with: - submodules: recursive - name: Download nargo binary uses: actions/download-artifact@v3 @@ -66,7 +67,7 @@ jobs: export PATH="$PATH:$nargo_bin_dir" echo $(which nargo) - $nargo_binary --version + nargo --version - name: Generate gates report working-directory: ./tooling/nargo_cli/tests