Skip to content
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
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
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
test-noir-wasm:
name: test noir wasm
runs-on: ubuntu-latest
needs: [build-base-js, test-source-resolver, build-base-nargo]
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-noir-wasm.sh
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
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
test-barretenberg-backend:
name: test barretenberg backend
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: 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]
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-noir-js.sh
test-noir_codegen:
name: test noir codegen
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: test
run: |
/usr/src/noir/.github/scripts/test-noir-codegen.sh