Skip to content

now attempting to use unit tests #4

now attempting to use unit tests

now attempting to use unit tests #4

name: run Perf Test and collect data
env:
default_image: "ghcr.io/meta-introspector/o1js/o1js-perf-recording:latest"
container_name: "unit-tests"
on:
workflow_dispatch:
inputs:
image_url:
description: 'Docker url to execute'
default: "ghcr.io/meta-introspector/o1js/o1js-perf-recording:latest"
push:
branches:
# add your branch here to auto trigger on push
#- "feature/just_test"
#- "feature/rebase"
- "feature/unit-tests"
pull_request:
branches: [ "collect-perf" ]
jobs:
build:
strategy:
matrix:
tests:
- "/app/src/lib/util/base58.unit-test.ts"
- "/app/src/lib/ml/consistency.unit-test.ts"
- "/app/src/lib/mina/account-update.unit-test.ts"
- "/app/src/lib/mina/hash-input.unit-test.ts"
- "/app/src/lib/mina/mina.unit-test.ts"
- "/app/src/lib/mina/actions/offchain-contract.unit-test.ts"
- "/app/src/lib/mina/actions/batch-reducer.unit-test.ts"
- "/app/src/lib/mina/actions/batch-reducer-program.unit-test.ts"
- "/app/src/lib/mina/test/dynamic-call.unit-test.ts"
- "/app/src/lib/mina/token/forest-iterator.unit-test.ts"
- "/app/src/lib/mina/token/token-contract.unit-test.ts"
- "/app/src/lib/mina/fetch.unit-test.ts"
- "/app/src/lib/mina/account-update-layout.unit-test.ts"
- "/app/src/lib/proof-system/proof-system.unit-test.ts"
- "/app/src/lib/proof-system/sideloaded.unit-test.ts"
- "/app/src/lib/provable/test/bitwise.unit-test.ts"
- "/app/src/lib/provable/test/base64.unit-test.ts"
- "/app/src/lib/provable/test/field.unit-test.ts"
- "/app/src/lib/provable/test/nullifier.unit-test.ts"
- "/app/src/lib/provable/test/provable.unit-test.ts"
- "/app/src/lib/provable/test/sha256.unit-test.ts"
- "/app/src/lib/provable/test/string.unit-test.ts"
- "/app/src/lib/provable/test/range-check.unit-test.ts"
- "/app/src/lib/provable/test/foreign-field.unit-test.ts"
- "/app/src/lib/provable/test/group.unit-test.ts"
- "/app/src/lib/provable/test/custom-gates-recursion.unit-test.ts"
- "/app/src/lib/provable/test/foreign-curve.unit-test.ts"
- "/app/src/lib/provable/test/foreign-field-gadgets.unit-test.ts"
- "/app/src/lib/provable/test/elliptic-curve.unit-test.ts"
- "/app/src/lib/provable/test/lookup.unit-test.ts"
- "/app/src/lib/provable/test/ecdsa.unit-test.ts"
- "/app/src/lib/provable/test/arithmetic.unit-test.ts"
- "/app/src/lib/provable/test/primitives.unit-test.ts"
- "/app/src/lib/provable/test/keccak.unit-test.ts"
- "/app/src/lib/provable/test/struct.unit-test.ts"
- "/app/src/lib/provable/test/merkle-tree.unit-test.ts"
- "/app/src/lib/testing/testing.unit-test.ts"
- "/app/src/mina-signer/tests/verify-in-snark.unit-test.ts"
- "/app/src/mina-signer/tests/zkapp.unit-test.ts"
- "/app/src/mina-signer/src/sign-legacy.unit-test.ts"
- "/app/src/mina-signer/src/transaction-hash.unit-test.ts"
- "/app/src/mina-signer/src/signature.unit-test.ts"
- "/app/src/mina-signer/src/sign-zkapp-command.unit-test.ts"
- "/app/src/bindings/lib/binable.unit-test.ts"
- "/app/src/bindings/crypto/bigint.unit-test.ts"
- "/app/src/bindings/crypto/finite-field.unit-test.ts"
- "/app/src/bindings/crypto/glv.unit-test.ts"
- "/app/src/bindings/crypto/poseidon.unit-test.ts"
- "/app/src/bindings/crypto/bindings/bindings.unit-test.ts"
- "/app/src/bindings/crypto/elliptic-curve.unit-test.ts"
runs-on: ubuntu-latest
steps:
- name: Sets NAME
env:
name: "${{matrix.tests}}"
run: |
TEST_NAME1=`echo $name | sed -e 's!/!-!g' `
echo "TEST_NAME=test${TEST_NAME1}" >> $GITHUB_ENV
- uses: meta-introspector/checkout@v4
#with:
# submodules: recursive
- name: Login to GHCR
uses: meta-introspector/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: pull the image
run: docker pull ${{ inputs.image_url || env.default_image }}
- name: run the Docker tests
run: TESTS=${{matrix.tests}} docker compose up ${{ env.container_name }}
env:
DOCKER_IMAGE_URL: ${{ inputs.image_url || env.default_image}}
- name: docker cp results
run: docker compose cp ${{ env.container_name }}:/tmp/perf.data.tar.gz perf.data.tar.gz
- name: Archive results
uses: meta-introspector/upload-artifact@v4
with:
name: ${{ env.TEST_NAME }}.perf.data.tar.gz
path: perf.data.tar.gz
- name: delete the results
run: rm -rf /tmp/perf*
- name: delete the container
run: |
docker compose down