Skip to content

fix: Make constant_to_radix emit a slice instead of an array (#4049) #159

fix: Make constant_to_radix emit a slice instead of an array (#4049)

fix: Make constant_to_radix emit a slice instead of an array (#4049) #159

name: Test Nargo and JS packages
on:
push:
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true
jobs:
build-base-nargo:
name: Build base nargo docker image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get current date
id: date
run: echo "date=$(date +'%Y.%m.%d.%H.%M')" >> $GITHUB_STATE
- name: prepare docker images tags
id: prep
run: |
REGISTRY="ghcr.io"
IMG_RAW="${REGISTRY}/${{ github.repository }}"
IMAGE=$(echo "$IMG_RAW" | tr '[:upper:]' '[:lower:]')
TAGS="${IMAGE}:${{ github.sha }}-nargo"
FULL_TAGS="${TAGS},${IMAGE}:latest-nargo,${IMAGE}:v${{ steps.date.outputs.date }}-nargo"
echo "tags=$FULL_TAGS" >> $GITHUB_OUTPUT
echo "image=$IMAGE" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build nargo base dockerfile
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ci
tags: ${{ steps.prep.outputs.tags }}
target: base-nargo
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
build-base-js:
name: Build base js docker image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get current date
id: date
run: echo "date=$(date +'%Y.%m.%d.%H.%M')" >> $GITHUB_STATE
- name: Prepare docker image tags
id: prep
run: |
REGISTRY="ghcr.io"
IMG_RAW="${REGISTRY}/${{ github.repository }}"
IMAGE=$(echo "$IMG_RAW" | tr '[:upper:]' '[:lower:]')
TAGS="${IMAGE}:${{ github.sha }}-js"
FULL_TAGS="${TAGS},${IMAGE}:latest-js,${IMAGE}:v${{ steps.date.outputs.date }}-js"
echo "tags=$FULL_TAGS" >> $GITHUB_OUTPUT
echo "image=$IMAGE" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build js base dockerfile
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ci
tags: ${{ steps.prep.outputs.tags }}
target: base-js
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
artifact-nargo:
name: Artifact nargo
runs-on: ubuntu-latest
needs: [build-base-nargo]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-nargo
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Artifact nargo
uses: actions/upload-artifact@v4
with:
name: nargo
path: /usr/src/noir/target/release/nargo
if-no-files-found: error
compression-level: 0
test-nargo:
name: Test nargo
runs-on: ubuntu-latest
needs: [build-base-nargo]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-nargo
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Test
working-directory: /usr/src/noir
run: |
.github/scripts/nargo-test.sh
build-noir-wasm:
name: Build noir wasm
runs-on: ubuntu-latest
needs: [build-base-js, build-noirc-abi]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-js
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Download noirc abi
uses: actions/download-artifact@v4
with:
name: noirc_abi_wasm
path: |
/usr/src/noir/tooling/noirc_abi_wasm
- name: Build
working-directory: /usr/src/noir
run: |
./.github/scripts/noir-wasm-build.sh
- name: Artifact
uses: actions/upload-artifact@v4
with:
name: noir_wasm
path: /usr/src/noir/compiler/wasm
retention-days: 10
test-noir-wasm:
name: Test noir wasm
runs-on: ubuntu-latest
needs: [build-base-js, artifact-nargo, build-noir-wasm]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-js
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Download nargo
uses: actions/download-artifact@v4
with:
name: nargo
path: /usr/src/noir/target/release
- name: Prep downloaded artifact
run: |
chmod +x /usr/src/noir/target/release/nargo
- name: Download noirc abi
uses: actions/download-artifact@v4
with:
name: noirc_abi_wasm
path: |
/usr/src/noir/tooling/noirc_abi_wasm
- name: Download noir_wasm artifact
uses: actions/download-artifact@v4
with:
name: noir_wasm
path: /usr/src/noir/compiler/wasm
- name: Test
working-directory: /usr/src/noir
run: |
./.github/scripts/noir-wasm-test.sh
test-noir-wasm-browser:
name: Test noir wasm browser
runs-on: ubuntu-latest
needs: [build-base-js, artifact-nargo, build-noir-wasm]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-js
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Download nargo
uses: actions/download-artifact@v4
with:
name: nargo
path: /usr/src/noir/target/release
- name: Prep downloaded artifact
run: |
chmod +x /usr/src/noir/target/release/nargo
- name: Download noirc abi
uses: actions/download-artifact@v4
with:
name: noirc_abi_wasm
path: |
/usr/src/noir/tooling/noirc_abi_wasm
- name: Download noir_wasm artifact
uses: actions/download-artifact@v4
with:
name: noir_wasm
path: /usr/src/noir/compiler/wasm
- name: Test
working-directory: /usr/src/noir
run: |
./.github/scripts/noir-wasm-test-browser.sh
build-acvm_js:
name: Build acvm js
runs-on: ubuntu-latest
needs: [build-base-js]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-js
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Build
working-directory: /usr/src/noir
run: |
./.github/scripts/acvm_js-build.sh
- name: Artifact
uses: actions/upload-artifact@v4
with:
name: acvm_js
path:
/usr/src/noir/acvm-repo/acvm_js/outputs/out/acvm_js
if-no-files-found: error
compression-level: 0
test-acvm_js:
name: Test acvm js
runs-on: ubuntu-latest
needs: [build-base-js, build-acvm_js]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-js
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Download acvm js
uses: actions/download-artifact@v4
with:
name: acvm_js
path: |
/usr/src/noir/acvm-repo/acvm_js
- name: Test
working-directory: /usr/src/noir
run: |
./.github/scripts/acvm_js-test.sh
test-acvm_js-browser:
name: Test acvm js browser
runs-on: ubuntu-latest
needs: [build-base-js, build-acvm_js]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-js
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Download acvm js
uses: actions/download-artifact@v4
with:
name: acvm_js
path: |
/usr/src/noir/acvm-repo/acvm_js
- name: Test
working-directory: /usr/src/noir
run: |
./.github/scripts/acvm_js-test-browser.sh
build-noirc-abi:
name: Build noirc abi
runs-on: ubuntu-latest
needs: [build-base-js]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-js
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Build
working-directory: /usr/src/noir
run: |
./.github/scripts/noirc-abi-build.sh
- name: Artifact
uses: actions/upload-artifact@v4
with:
name: noirc_abi_wasm
path:
/usr/src/noir/tooling/noirc_abi_wasm/outputs/out/noirc_abi_wasm
if-no-files-found: error
compression-level: 0
test-noirc-abi:
name: Test noirc abi
runs-on: ubuntu-latest
needs: [build-base-js, build-noirc-abi]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-js
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Download noirc abi
uses: actions/download-artifact@v4
with:
name: noirc_abi_wasm
path: |
/usr/src/noir/tooling/noirc_abi_wasm
- name: Test
working-directory: /usr/src/noir
run: |
./.github/scripts/noirc-abi-test.sh
test-noirc-abi-browser:
name: Test noirc abi browser
runs-on: ubuntu-latest
needs: [build-base-js, build-noirc-abi]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-js
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Download noirc abi
uses: actions/download-artifact@v4
with:
name: noirc_abi_wasm
path: |
/usr/src/noir/tooling/noirc_abi_wasm
- name: Test
working-directory: /usr/src/noir
run: |
./.github/scripts/noirc-abi-test-browser.sh
build-noir-js-types:
name: Build noir js types
runs-on: ubuntu-latest
needs: [build-base-js, build-noirc-abi]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-js
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Download noirc abi
uses: actions/download-artifact@v4
with:
name: noirc_abi_wasm
path: |
/usr/src/noir/tooling/noirc_abi_wasm
- name: Build
working-directory: /usr/src/noir
run: |
./.github/scripts/noir-js-types-build.sh
- name: Artifact
uses: actions/upload-artifact@v4
with:
name: noir-js-types
path: |
/usr/src/noir/tooling/noir_js_types/lib
if-no-files-found: error
compression-level: 0
build-barretenberg-backend:
name: Build Barretenberg backend
runs-on: ubuntu-latest
needs: [build-base-js, build-noirc-abi, build-noir-js-types]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-js
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Download noirc abi
uses: actions/download-artifact@v4
with:
name: noirc_abi_wasm
path: |
/usr/src/noir/tooling/noirc_abi_wasm
- name: Download noir js types
uses: actions/download-artifact@v4
with:
name: noir-js-types
path: /usr/src/noir/tooling/noir_js_types/lib/
- name: Build
working-directory: /usr/src/noir
run: |
./.github/scripts/backend-barretenberg-build.sh
- name: Artifact
uses: actions/upload-artifact@v4
with:
name: barretenberg-backend
path:
/usr/src/noir/tooling/noir_js_backend_barretenberg/lib
if-no-files-found: error
compression-level: 0
test-barretenberg-backend:
name: Test Barretenberg backend
runs-on: ubuntu-latest
needs: [build-base-js, build-noirc-abi, build-noir-js-types, build-barretenberg-backend]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-js
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: noirc_abi_wasm
path: |
/usr/src/noir/tooling/noirc_abi_wasm
- name: Download noir js types
uses: actions/download-artifact@v4
with:
name: noir-js-types
path: /usr/src/noir/tooling/noir_js_types/lib/
- name: Download Backend barretenberg
uses: actions/download-artifact@v4
with:
name: barretenberg-backend
path:
/usr/src/noir/tooling/noir_js_backend_barretenberg/lib
- name: Test
working-directory: /usr/src/noir
run: |
./.github/scripts/backend-barretenberg-test.sh
build-noir_js:
name: Build noirjs
runs-on: ubuntu-latest
needs: [build-base-js, artifact-nargo, build-noirc-abi, build-acvm_js, build-barretenberg-backend, build-noir-js-types]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-js
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Download nargo
uses: actions/download-artifact@v4
with:
name: nargo
path: /usr/src/noir/target/release
- name: prep downloaded artifact
run: |
chmod +x /usr/src/noir/target/release/nargo
- name: Download noirc abi
uses: actions/download-artifact@v4
with:
name: noirc_abi_wasm
path: |
/usr/src/noir/tooling/noirc_abi_wasm
- name: Download acvm js
uses: actions/download-artifact@v4
with:
name: acvm_js
path: |
/usr/src/noir/acvm-repo/acvm_js
- name: Download Barretenberg backend
uses: actions/download-artifact@v4
with:
name: barretenberg-backend
path:
/usr/src/noir/tooling/noir_js_backend_barretenberg/lib
- name: Download noir js types
uses: actions/download-artifact@v4
with:
name: noir-js-types
path: |
/usr/src/noir/tooling/noir_js_types/lib
- name: Build
working-directory: /usr/src/noir
run: |
./.github/scripts/noir-js-build.sh
- name: Artifact
uses: actions/upload-artifact@v4
with:
name: noir_js
path:
/usr/src/noir/tooling/noir_js/lib
test-noir_js:
name: Test noirjs
runs-on: ubuntu-latest
needs: [
build-base-js,
build-noirc-abi,
artifact-nargo,
build-acvm_js,
build-barretenberg-backend,
build-noir_js,
build-noir-js-types
]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-js
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Download nargo
uses: actions/download-artifact@v4
with:
name: nargo
path: /usr/src/noir/target/release
- name: Prep downloaded artifact
run: |
chmod +x /usr/src/noir/target/release/nargo
- name: Download noirc abi
uses: actions/download-artifact@v4
with:
name: noirc_abi_wasm
path: |
/usr/src/noir/tooling/noirc_abi_wasm
- name: Download acvm js
uses: actions/download-artifact@v4
with:
name: acvm_js
path: |
/usr/src/noir/acvm-repo/acvm_js
- name: Download Barretenberg backend
uses: actions/download-artifact@v4
with:
name: barretenberg-backend
path:
/usr/src/noir/tooling/noir_js_backend_barretenberg/lib
- name: Download noir js types
uses: actions/download-artifact@v4
with:
name: noir-js-types
path: |
/usr/src/noir/tooling/noir_js_types/lib
- name: Download noir js
uses: actions/download-artifact@v4
with:
name: noir_js
path:
/usr/src/noir/tooling/noir_js/lib
- name: Test
working-directory: /usr/src/noir
run: |
./.github/scripts/noir-js-test.sh
build-noir_codegen:
name: Build noir codegen
runs-on: ubuntu-latest
needs: [build-base-js, build-noirc-abi, build-acvm_js, build-noir-js-types, build-noir_js]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-js
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Download nargo
uses: actions/download-artifact@v4
with:
name: nargo
path: /usr/src/noir/target/release
- name: Prep downloaded artifact
run: |
chmod +x /usr/src/noir/target/release/nargo
- name: Download noirc abi package
uses: actions/download-artifact@v4
with:
name: noirc_abi_wasm
path: /usr/src/noir/tooling/noirc_abi_wasm
- name: Download acvm js
uses: actions/download-artifact@v4
with:
name: acvm_js
path: /usr/src/noir/acvm-repo/acvm_js
- name: Download noir js types
uses: actions/download-artifact@v4
with:
name: noir-js-types
path: |
/usr/src/noir/tooling/noir_js_types/lib
- name: Download noir js
uses: actions/download-artifact@v4
with:
name: noir_js
path:
/usr/src/noir/tooling/noir_js/lib
- name: Build
working-directory: /usr/src/noir
run: |
./.github/scripts/noir-codegen-build.sh
- name: Artifact
uses: actions/upload-artifact@v4
with:
name: noir_codegen
path:
/usr/src/noir/tooling/noir_codegen/lib
test-noir_codegen:
name: Test noir codegen
runs-on: ubuntu-latest
needs: [build-base-js, artifact-nargo, build-noirc-abi, build-acvm_js, build-noir-js-types, build-noir_js, build-noir_codegen]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-js
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Download nargo
uses: actions/download-artifact@v4
with:
name: nargo
path: /usr/src/noir/target/release
- name: Prep downloaded artifact
run: |
chmod +x /usr/src/noir/target/release/nargo
- name: Download noirc abi
uses: actions/download-artifact@v4
with:
name: noirc_abi_wasm
path: /usr/src/noir/tooling/noirc_abi_wasm
- name: Download acvm js
uses: actions/download-artifact@v4
with:
name: acvm_js
path: /usr/src/noir/acvm-repo/acvm_js
- name: Download noir js types
uses: actions/download-artifact@v4
with:
name: noir-js-types
path: |
/usr/src/noir/tooling/noir_js_types/lib
- name: Download noir js
uses: actions/download-artifact@v4
with:
name: noir_js
path:
/usr/src/noir/tooling/noir_js/lib
- name: Download noir codegen
uses: actions/download-artifact@v4
with:
name: noir_codegen
path:
/usr/src/noir/tooling/noir_codegen/lib
- name: Test
working-directory: /usr/src/noir
run: |
./.github/scripts/noir-codegen-test.sh
test-integration:
name: Integration test
runs-on: ubuntu-latest
needs: [
build-base-js,
artifact-nargo,
build-noir-wasm,
build-noirc-abi,
build-acvm_js,
build-noir-js-types,
build-noir_js,
build-barretenberg-backend
]
container:
image: ghcr.io/noir-lang/noir:${{ github.sha }}-js
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Download nargo
uses: actions/download-artifact@v4
with:
name: nargo
path: /usr/src/noir/target/release
- name: Prep downloaded artifact
run: |
chmod +x /usr/src/noir/target/release/nargo
- name: Download noir wasm
uses: actions/download-artifact@v4
with:
name: noir_wasm
path: /usr/src/noir/compiler/wasm
- name: Download noirc abi
uses: actions/download-artifact@v4
with:
name: noirc_abi_wasm
path: /usr/src/noir/tooling/noirc_abi_wasm
- name: Download acvm js
uses: actions/download-artifact@v4
with:
name: acvm_js
path: /usr/src/noir/acvm-repo/acvm_js
- name: Download noir js types
uses: actions/download-artifact@v4
with:
name: noir-js-types
path: |
/usr/src/noir/tooling/noir_js_types/lib
- name: Download noir js
uses: actions/download-artifact@v4
with:
name: noir_js
path:
/usr/src/noir/tooling/noir_js/lib
- name: Download Barretenberg backend
uses: actions/download-artifact@v4
with:
name: barretenberg-backend
path:
/usr/src/noir/tooling/noir_js_backend_barretenberg/lib
- name: Test
working-directory: /usr/src/noir
run: |
./.github/scripts/integration-test.sh
tests-end:
name: End
runs-on: ubuntu-latest
if: ${{ always() }}
needs:
- test-nargo
- test-noirc-abi
- test-noirc-abi-browser
- test-noir-wasm
- test-noir-wasm-browser
- test-integration
- test-noir_codegen
- test-acvm_js
- test-acvm_js-browser
- test-barretenberg-backend
- test-noir_js
steps:
- name: Report overall success
run: |
if [[ $FAIL == true ]]; then
exit 1
else
exit 0
fi
env:
FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') }}