Skip to content

Commit

Permalink
Run tests on AWS runners, separate workflows for linux and mac. (#253)
Browse files Browse the repository at this point in the history
* Separate linux-mac workflows, run on aws auto-scaling.

* Temporarily disable most targets on mac.
  • Loading branch information
martun authored Dec 12, 2023
1 parent 92be48e commit d8bd4e1
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 146 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/publish-results.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
43 changes: 43 additions & 0 deletions .github/workflows/pull-request-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Reusable PR testing for mac and linux

on:
workflow_call:
inputs:
targets:
type: string
description: "Make and CTest targets. If not specified, everything is tested"
required: false

jobs:
handle-syncwith:
name: Call Reusable SyncWith Handler
uses: NilFoundation/ci-cd/.github/workflows/[email protected]
with:
ci-cd-ref: 'v1.1.3'
secrets: inherit

matrix-test-linux:
name: Linux Reusable Crypto3 Testing
needs:
- handle-syncwith
uses: NilFoundation/ci-cd/.github/workflows/[email protected]

secrets: inherit
with:
submodules-refs: ${{ needs.handle-syncwith.outputs.prs-refs }}

targets: ${{ inputs.targets }}

matrix-test-mac:
name: Mac Reusable Crypto3 Testing
needs:
- handle-syncwith
uses: NilFoundation/ci-cd/.github/workflows/[email protected]

secrets: inherit
with:
submodules-refs: ${{ needs.handle-syncwith.outputs.prs-refs }}

# TODO(martun): fix this sometime soon. All the targets must work on mac.
targets: crypto3_zk_math_expression_test # ${{ inputs.targets }}

28 changes: 28 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: PR Testing

on:
pull_request:
types:
- opened
- synchronize

jobs:
run-pull-request-actions:
name: Reusable Crypto3 Testing
uses: ./.github/workflows/pull-request-action.yml

secrets: inherit
with:
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
145 changes: 0 additions & 145 deletions .github/workflows/run_tests.yml

This file was deleted.

14 changes: 13 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,19 @@ endif()
macro(define_zk_test test)
get_filename_component(name ${test} NAME)
string(REPLACE "/" "_" full_test_name ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}_${test}_test)
cm_test(NAME ${full_test_name} SOURCES ${test}.cpp)

set(additional_args "")

if(ENABLE_JUNIT_TEST_OUTPUT)
set(TEST_RESULTS_DIR "${CMAKE_CURRENT_BINARY_DIR}/junit_results")
set(TEST_LOGS_DIR "${TEST_RESULTS_DIR}/logs")
file(MAKE_DIRECTORY ${TEST_LOGS_DIR})

set(additional_args "--log_format=JUNIT"
"--log_sink=${TEST_LOGS_DIR}/${full_test_name}.xml")
endif()

cm_test(NAME ${full_test_name} SOURCES ${test}.cpp ARGS ${additional_args})

target_include_directories(${full_test_name} PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
Expand Down

0 comments on commit d8bd4e1

Please sign in to comment.