diff --git a/.github/workflows/publish-results.yml b/.github/workflows/publish-results.yml new file mode 100644 index 000000000..4b7b9f332 --- /dev/null +++ b/.github/workflows/publish-results.yml @@ -0,0 +1,13 @@ +# Needed to publish test results in fork +name: Testing Callback + +on: + workflow_run: + workflows: ["PR Testing"] + types: + - completed + +jobs: + call-reusable-workflow: + name: Call Reusable Testing Callback Workflow + uses: NilFoundation/ci-cd/.github/workflows/reusable-crypto3-publish-result.yml@v1 diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 000000000..95477737b --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,63 @@ +name: PR Testing + +on: + pull_request: + types: + - opened + - synchronize + +jobs: + handle-syncwith: + name: Call Reusable SyncWith Handler + uses: NilFoundation/ci-cd/.github/workflows/reusable-handle-syncwith.yml@v1.1.0 + with: + ci-cd-ref: 'v1.1.3' + secrets: inherit + + matrix-test: + name: Linux Reusable Crypto3 Testing + needs: + - handle-syncwith + uses: NilFoundation/ci-cd/.github/workflows/reusable-crypto3-testing-linux.yml@217b1e0ba108844fbdf1186fe81849a0273b724e + + secrets: inherit + with: + submodules-refs: ${{ needs.handle-syncwith.outputs.prs-refs }} + + targets: | + crypto3_zk_commitment_fold_polynomial_test + crypto3_zk_commitment_fri_test + crypto3_zk_commitment_lpc_test + crypto3_zk_commitment_kzg_test + crypto3_zk_systems_plonk_placeholder_placeholder_test + crypto3_zk_commitment_powers_of_tau_test + crypto3_zk_commitment_proof_of_knowledge_test + crypto3_zk_commitment_r1cs_gg_ppzksnark_mpc_test + crypto3_zk_math_expression_test + crypto3_zk_systems_plonk_plonk_constraint_test + crypto3_zk_commitment_proof_of_knowledge_test + crypto3_zk_transcript_transcript_test + + matrix-test: + name: Mac Reusable Crypto3 Testing + needs: + - handle-syncwith + uses: NilFoundation/ci-cd/.github/workflows/reusable-crypto3-testing-mac.yml@217b1e0ba108844fbdf1186fe81849a0273b724e + + secrets: inherit + with: + submodules-refs: ${{ needs.handle-syncwith.outputs.prs-refs }} + + targets: | + crypto3_zk_commitment_fold_polynomial_test + crypto3_zk_commitment_fri_test + crypto3_zk_commitment_lpc_test + crypto3_zk_commitment_kzg_test + crypto3_zk_systems_plonk_placeholder_placeholder_test + crypto3_zk_commitment_powers_of_tau_test + crypto3_zk_commitment_proof_of_knowledge_test + crypto3_zk_commitment_r1cs_gg_ppzksnark_mpc_test + crypto3_zk_math_expression_test + crypto3_zk_systems_plonk_plonk_constraint_test + crypto3_zk_commitment_proof_of_knowledge_test + crypto3_zk_transcript_transcript_test diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml deleted file mode 100644 index 3086f1600..000000000 --- a/.github/workflows/run_tests.yml +++ /dev/null @@ -1,145 +0,0 @@ -name: Run tests - -on: - push: - branches: - - master - pull_request: - - # Allows you to run this workflow manually from the Actions tab - #workflow_dispatch: - -env: - SUITE_REPO: "NilFoundation/crypto3" - LIB_NAME: "zk" - CACHE_NAME: "checkout-job-cache" - -jobs: - handle-syncwith: - if: github.event_name == 'pull_request' - name: Call Reusable SyncWith Handler - uses: NilFoundation/ci-cd/.github/workflows/reusable-handle-syncwith.yml@v1 - with: - ci-cd-ref: 'v1' - secrets: inherit - - checkout: - runs-on: [self-hosted, tests-runner] - needs: [handle-syncwith] - steps: - - name: Cleanup # TODO - move to scripts on runner - run: | - rm -rf ./* || true - rm -rf ./.??* || true - - - name: Checkout suite - uses: actions/checkout@v3 - with: - repository: ${{ env.SUITE_REPO }} - submodules: recursive - - - name: Checkout source code - uses: actions/checkout@v3 - with: - path: ./libs/${{ env.LIB_NAME }} - submodules: recursive - - - name: Checkout modules to specified refs - if: needs.handle-syncwith.outputs.prs-refs != '' - uses: NilFoundation/ci-cd/actions/recursive-checkout@v1 - with: - paths: | - ./** - !./**/.git/** - refs: ${{ needs.handle-syncwith.outputs.prs-refs }} - - - name: Cmake and build - env: - CMAKE_ARGS: " - -DCMAKE_BUILD_TYPE=Debug - -DBUILD_SHARED_LIBS=FALSE - -DBUILD_TESTS=TRUE - -DZK_PLACEHOLDER_PROFILING=TRUE - " - run: | - mkdir build - cd build - cmake ${{ env.CMAKE_ARGS }} .. - - - name: Archive build results - run: | - touch ${{ env.CACHE_NAME }}.tar.gz - tar -czf ${{ env.CACHE_NAME }}.tar.gz --exclude=${{ env.CACHE_NAME }}.tar.gz . - - - name: Cache archived job output - uses: actions/upload-artifact@v3 - with: - name: ${{ env.CACHE_NAME }} - path: ${{ env.CACHE_NAME }}.tar.gz - retention-days: 1 - - - run_tests: - runs-on: [self-hosted, tests-runner] - needs: [checkout] - strategy: - fail-fast: false - matrix: - target: [ - crypto3_zk_commitment_fold_polynomial_test, - crypto3_zk_commitment_fri_test, - crypto3_zk_commitment_lpc_test, - crypto3_zk_commitment_kzg_test, - crypto3_zk_systems_plonk_placeholder_placeholder_test, - crypto3_zk_commitment_powers_of_tau_test, - crypto3_zk_commitment_proof_of_knowledge_test, - crypto3_zk_commitment_r1cs_gg_ppzksnark_mpc_test, - crypto3_zk_math_expression_test, - crypto3_zk_systems_plonk_plonk_constraint_test, - crypto3_zk_commitment_proof_of_knowledge_test, - crypto3_zk_transcript_transcript_test - - # Performance tests pass, but they are excluded from here due to speed. - # crypto3_zk_commitment_lpc_performance_test - - # The following tests are temporarily failing. - # crypto3_zk_commitment_pedersen_test - # crypto3_zk_transcript_kimchi_transcript_test - # crypto3_zk_commitment_kimchi_pedersen_test - # crypto3_zk_commitment_type_traits_test - # crypto3_zk_relations_numeric_qap_test - # crypto3_zk_relations_numeric_sap_test - # crypto3_zk_relations_numeric_ssp_test - # crypto3_zk_routing_algorithms_test_routing_algorithms_test - # crypto3_zk_systems_pcd_r1cs_pcd_r1cs_mp_ppzkpcd_r1cs_mp_ppzkpcd_test - # crypto3_zk_systems_plonk_pickles_kimchi_test - # crypto3_zk_systems_plonk_pickles_oracles_test - - ] # Tests to execute - steps: - - name: Cleanup # TODO - move to scripts on runner - run: | - rm -rf ./* || true - rm -rf ./.??* || true - - - name: Upload checkout job cache - uses: actions/download-artifact@v3 - with: - name: ${{ env.CACHE_NAME }} - - - name: Extract artifacts - run: | - tar -xf ${{ env.CACHE_NAME }}.tar.gz - rm ${{ env.CACHE_NAME }}.tar.gz - - - name: Build - working-directory: ./build - run: cmake --build . -t ${{ matrix.target }} - - - name: Run test - working-directory: ./build - run: | - cd libs/${{ env.LIB_NAME }}/test - COLOR='\033[0;33m' - echo -e "${COLOR}${{ matrix.target }}" - ./${{ matrix.target }}