|
| 1 | +name: run Perf Test and collect data |
| 2 | +env: |
| 3 | + default_image: "ghcr.io/meta-introspector/o1js/o1js-perf-recording:latest" |
| 4 | + container_name: "unit-tests" |
| 5 | +on: |
| 6 | + workflow_dispatch: |
| 7 | + inputs: |
| 8 | + image_url: |
| 9 | + description: 'Docker url to execute' |
| 10 | + default: "ghcr.io/meta-introspector/o1js/o1js-perf-recording:latest" |
| 11 | + push: |
| 12 | + branches: |
| 13 | + # add your branch here to auto trigger on push |
| 14 | + #- "feature/just_test" |
| 15 | + #- "feature/rebase" |
| 16 | + - "feature/unit-tests" |
| 17 | + pull_request: |
| 18 | + branches: [ "collect-perf" ] |
| 19 | +jobs: |
| 20 | + build: |
| 21 | + strategy: |
| 22 | + matrix: |
| 23 | + tests: |
| 24 | + - "/app/dist/node/lib/util/base58.unit-test.js" |
| 25 | + - "/app/dist/node/lib/ml/consistency.unit-test.js" |
| 26 | + - "/app/dist/node/lib/mina/account-update.unit-test.js" |
| 27 | + - "/app/dist/node/lib/mina/hash-input.unit-test.js" |
| 28 | + - "/app/dist/node/lib/mina/mina.unit-test.js" |
| 29 | + - "/app/dist/node/lib/mina/actions/offchain-contract.unit-test.js" |
| 30 | + - "/app/dist/node/lib/mina/actions/batch-reducer.unit-test.js" |
| 31 | + - "/app/dist/node/lib/mina/actions/batch-reducer-program.unit-test.js" |
| 32 | + - "/app/dist/node/lib/mina/test/dynamic-call.unit-test.js" |
| 33 | + - "/app/dist/node/lib/mina/token/forest-iterator.unit-test.js" |
| 34 | + - "/app/dist/node/lib/mina/token/token-contract.unit-test.js" |
| 35 | + - "/app/dist/node/lib/mina/fetch.unit-test.js" |
| 36 | + - "/app/dist/node/lib/mina/account-update-layout.unit-test.js" |
| 37 | + - "/app/dist/node/lib/proof-system/proof-system.unit-test.js" |
| 38 | + - "/app/dist/node/lib/proof-system/sideloaded.unit-test.js" |
| 39 | + - "/app/dist/node/lib/provable/test/bitwise.unit-test.js" |
| 40 | + - "/app/dist/node/lib/provable/test/base64.unit-test.js" |
| 41 | + - "/app/dist/node/lib/provable/test/field.unit-test.js" |
| 42 | + - "/app/dist/node/lib/provable/test/nullifier.unit-test.js" |
| 43 | + - "/app/dist/node/lib/provable/test/provable.unit-test.js" |
| 44 | + - "/app/dist/node/lib/provable/test/sha256.unit-test.js" |
| 45 | + - "/app/dist/node/lib/provable/test/string.unit-test.js" |
| 46 | + - "/app/dist/node/lib/provable/test/range-check.unit-test.js" |
| 47 | + - "/app/dist/node/lib/provable/test/foreign-field.unit-test.js" |
| 48 | + - "/app/dist/node/lib/provable/test/group.unit-test.js" |
| 49 | + - "/app/dist/node/lib/provable/test/custom-gates-recursion.unit-test.js" |
| 50 | + - "/app/dist/node/lib/provable/test/foreign-curve.unit-test.js" |
| 51 | + - "/app/dist/node/lib/provable/test/foreign-field-gadgets.unit-test.js" |
| 52 | + - "/app/dist/node/lib/provable/test/elliptic-curve.unit-test.js" |
| 53 | + - "/app/dist/node/lib/provable/test/lookup.unit-test.js" |
| 54 | + - "/app/dist/node/lib/provable/test/ecdsa.unit-test.js" |
| 55 | + - "/app/dist/node/lib/provable/test/arithmetic.unit-test.js" |
| 56 | + - "/app/dist/node/lib/provable/test/primitives.unit-test.js" |
| 57 | + - "/app/dist/node/lib/provable/test/keccak.unit-test.js" |
| 58 | + - "/app/dist/node/lib/provable/test/struct.unit-test.js" |
| 59 | + - "/app/dist/node/lib/provable/test/merkle-tree.unit-test.js" |
| 60 | + - "/app/dist/node/lib/testing/testing.unit-test.js" |
| 61 | + - "/app/dist/node/mina-signer/tests/verify-in-snark.unit-test.js" |
| 62 | + - "/app/dist/node/mina-signer/tests/zkapp.unit-test.js" |
| 63 | + - "/app/dist/node/mina-signer/src/sign-legacy.unit-test.js" |
| 64 | + - "/app/dist/node/mina-signer/src/transaction-hash.unit-test.js" |
| 65 | + - "/app/dist/node/mina-signer/src/signature.unit-test.js" |
| 66 | + - "/app/dist/node/mina-signer/src/sign-zkapp-command.unit-test.js" |
| 67 | + - "/app/dist/node/bindings/lib/binable.unit-test.js" |
| 68 | + - "/app/dist/node/bindings/crypto/bigint.unit-test.js" |
| 69 | + - "/app/dist/node/bindings/crypto/finite-field.unit-test.js" |
| 70 | + - "/app/dist/node/bindings/crypto/glv.unit-test.js" |
| 71 | + - "/app/dist/node/bindings/crypto/poseidon.unit-test.js" |
| 72 | + - "/app/dist/node/bindings/crypto/bindings/bindings.unit-test.js" |
| 73 | + - "/app/dist/node/bindings/crypto/elliptic-curve.unit-test.js" |
| 74 | + |
| 75 | + runs-on: ubuntu-latest |
| 76 | + steps: |
| 77 | + - name: Sets NAME |
| 78 | + env: |
| 79 | + name: "${{matrix.tests}}" |
| 80 | + run: | |
| 81 | + TEST_NAME1=`echo $name | sed -e 's!/!-!g' ` |
| 82 | + echo "TEST_NAME=test${TEST_NAME1}" >> $GITHUB_ENV |
| 83 | +
|
| 84 | + - uses: meta-introspector/checkout@v4 |
| 85 | + #with: |
| 86 | + # submodules: recursive |
| 87 | + |
| 88 | + - name: Login to GHCR |
| 89 | + uses: meta-introspector/login-action@v1 |
| 90 | + with: |
| 91 | + registry: ghcr.io |
| 92 | + username: ${{ github.actor }} |
| 93 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 94 | + |
| 95 | + - name: pull the image |
| 96 | + run: docker pull ${{ inputs.image_url || env.default_image }} |
| 97 | + |
| 98 | + - name: run the Docker tests |
| 99 | + run: TESTS=${{matrix.tests}} docker compose up ${{ env.container_name }} |
| 100 | + env: |
| 101 | + DOCKER_IMAGE_URL: ${{ inputs.image_url || env.default_image}} |
| 102 | + |
| 103 | + - name: docker cp results |
| 104 | + run: docker compose cp ${{ env.container_name }}:/tmp/perf.data.tar.gz perf.data.tar.gz |
| 105 | + |
| 106 | + - name: Archive results |
| 107 | + uses: meta-introspector/upload-artifact@v4 |
| 108 | + with: |
| 109 | + name: ${{ env.TEST_NAME }}.perf.data.tar.gz |
| 110 | + path: perf.data.tar.gz |
| 111 | + |
| 112 | + - name: delete the results |
| 113 | + run: rm -rf /tmp/perf* |
| 114 | + |
| 115 | + - name: delete the container |
| 116 | + run: | |
| 117 | + docker compose down |
0 commit comments