Skip to content

noirjs

noirjs #45

name: Test github artifacts
on:
push:
branches:
# - 'master'
- 'cache-docker-artifacts'
jobs:
build-base-js:
name: Build base js 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="${REGISTRY}/${{ github.repository }}"
IMAGE=$(echo "$IMG" | tr '[:upper:]' '[:lower:]')
TAGS="${IMAGE}:${{ github.sha }}-js"
TAGS="${TAGS},${IMAGE}:latest-js,${IMAGE}:v${{ steps.date.outputs.date }}-js"
echo "tags=$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 cargo
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
build-base-nargo:
name: Build base nargo
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="${REGISTRY}/${{ github.repository }}"
IMAGE=$(echo "$IMG" | tr '[:upper:]' '[:lower:]')
TAGS="${IMAGE}:${{ github.sha }}-nargo"
TAGS="${TAGS},${IMAGE}:latest-nargo,${IMAGE}:v${{ steps.date.outputs.date }}-nargo"
# echo ::set-output name=tags::${TAGS}
echo "tags=$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 cargo
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
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
uses: actions/upload-artifact@v4
with:
name: nargo
path: /usr/src/noir/target/release/nargo
if-no-files-found: error
compression-level: 0
#done
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
run: |
/usr/src/noir/.github/scripts/test-nargo.sh
#done
test-source-resolver:
name: test source resolver
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: test
run: |
/usr/src/noir/.github/scripts/test-source-resolver.sh
- name: artifact
uses: actions/upload-artifact@v4
with:
name: source-resolver
path: |
/usr/src/noir/compiler/source-resolver/lib
/usr/src/noir/compiler/source-resolver/lib-node
/usr/src/noir/compiler/source-resolver/types
if-no-files-found: error
#done
build-noir-js-types:
name: build noir types
runs-on: ubuntu-latest
needs: [build-base-js, test-noirc-abi]
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: build
run: |
/usr/src/noir/.github/scripts/build-noir-js-types.sh
- name: artifact
uses: actions/upload-artifact@v4
with:
name: noir-js-types
path: |
/usr/src/noir/tooling/noir_js_types/lib/cjs
/usr/src/noir/tooling/noir_js_types/lib/esm
if-no-files-found: error
compression-level: 0
# DONE
test-noir-wasm:
name: test noir wasm
runs-on: ubuntu-latest
needs: [build-base-js, test-source-resolver, artifact-nargo]
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 source-resolver
uses: actions/download-artifact@v4
with:
name: source-resolver
path: /usr/src/noir/compiler/source-resolver
- name: test
run: |
/usr/src/noir/.github/scripts/test-noir-wasm.sh
#DONE
test-acvm-js:
name: test 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: test
run: |
/usr/src/noir/.github/scripts/test-acvm-js.sh
- name: artifact
uses: actions/upload-artifact@v4
with:
name: acvm-js
path: |
/usr/src/noir/acvm-repo/acvm-js/nodejs
/usr/src/noir/acvm-repo/acvm-js/web
/usr/src/noir/acvm-repo/acvm-js/target
/usr/src/noir/acvm-repo/acvm-js/outputs
/usr/src/noir/acvm-repo/acvm-js/result
if-no-files-found: error
compression-level: 0
#DONE
test-noirc-abi:
name: test 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: test
run: |
/usr/src/noir/.github/scripts/test-noirc-abi.sh
- name: artifact
uses: actions/upload-artifact@v4
with:
name: noirc-abi-wasm
path: |
/usr/src/noir/tooling/noirc_abi_wasm/nodejs
/usr/src/noir/tooling/noirc_abi_wasm/web
/usr/src/noir/tooling/noirc_abi_wasm/target
/usr/src/noir/tooling/noirc_abi_wasm/outputs
/usr/src/noir/tooling/noirc_abi_wasm/result
if-no-files-found: error
compression-level: 0
# DONE
test-barretenberg-backend:
name: test barretenberg backend
runs-on: ubuntu-latest
needs: [build-base-js, test-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 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: test
run: |
/usr/src/noir/.github/scripts/test-backend-barretenberg.sh
test-noir_js:
name: test noirjs
runs-on: ubuntu-latest
needs: [build-base-js, test-noirc-abi, artifact-nargo, test-acvm-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 artifact
uses: actions/download-artifact@v4
with:
name: noirc-abi-wasm
path: |
/usr/src/noir/tooling/noirc_abi_wasm
- name: download artifact
uses: actions/download-artifact@v4
with:
name: acvm-js
path: |
/usr/src/noir/acvm-repo/acvm-js/
- name: test
run: |
/usr/src/noir/.github/scripts/test-noir-js.sh
# DONE
test-noir_codegen:
name: test noir codegen
runs-on: ubuntu-latest
needs: [build-base-js, artifact-nargo, test-noirc-abi]
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 artifact
uses: actions/download-artifact@v4
with:
name: noirc-abi-wasm
path: |
/usr/src/noir/tooling/noirc_abi_wasm
- name: test
run: |
/usr/src/noir/.github/scripts/test-noir-codegen.sh