Skip to content

Commit

Permalink
cleanup cmake; use nix-based CI
Browse files Browse the repository at this point in the history
  • Loading branch information
MALASHKIN Andrei authored and AndreyMlashkin committed May 21, 2024
1 parent 6431244 commit ed375cd
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 95 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/publish-results.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/pull-request-action.yml

This file was deleted.

58 changes: 39 additions & 19 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,47 @@ name: PR Testing

on:
pull_request:
types:
- opened
- synchronize
push:
branches:
- master

concurrency:
# In master we want to run for every commit, in other branches — only for the last one
group: ${{
( github.ref == 'refs/heads/master' && format('{0}/{1}/{2}', github.workflow, github.ref, github.sha) )
||
format('{0}/{1}', github.workflow, github.ref) }}
cancel-in-progress: true

jobs:
run-pull-request-actions:
name: Reusable Crypto3 Testing
uses: ./.github/workflows/pull-request-action.yml
handle-syncwith:
name: Call Reusable SyncWith Handler
uses: NilFoundation/ci-cd/.github/workflows/reusable-handle-syncwith.yml@v1.2.1
with:
ci-cd-ref: 'v1.2.1'
secrets: inherit

test-linux:
name: Linux Reusable Crypto3 Testing
needs:
- handle-syncwith
uses: NilFoundation/crypto3/.github/workflows/reusable-submodule-testing-linux.yml@1bd56b12f410f3f1a4891076705a9261a6b1efaa

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_math_expression_test
crypto3_zk_systems_plonk_plonk_constraint_test
crypto3_zk_commitment_proof_of_knowledge_test
crypto3_zk_transcript_transcript_test
crypto3_zk_commitment_proof_of_work_test
submodules-refs: ${{ needs.handle-syncwith.outputs.prs-refs }}
check-names: |
zk-clang
# test-mac:
# name: Mac Reusable Crypto3 Testing
# needs:
# - handle-syncwith
# uses: NilFoundation/crypto3/.github/workflows/reusable-submodule-testing-mac.yml@ede1d6b903078a0aa48a6864ba465b66af4fda8b

# secrets: inherit
# with:
# submodules-refs: ${{ needs.handle-syncwith.outputs.prs-refs }}
# check-names: |
# algebra-clang

21 changes: 3 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,15 @@ if(ZK_PLACEHOLDER_DEBUG)
add_definitions(-DZK_PLACEHOLDER_DEBUG_ENABLED)
endif()

macro(cm_find_package NAME)
foreach(ITERATOR ${CMAKE_WORKSPACE_LIST})
if(NOT "${NAME}" MATCHES "^${ITERATOR}_.*$" AND NOT "${NAME}" STREQUAL CM)
find_package(${ARGV})
else()
set(${ARGV0}_FOUND ON CACHE BOOL "")
endif()
endforeach()
endmacro()

cm_project(zk WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES C CXX)

if(NOT Boost_FOUND AND NOT CMAKE_CROSSCOMPILING)
cm_find_package(Boost)
find_package(Boost)
endif()

cm_find_package(CM)
include(CMDeploy)
include(FindPkgConfig)

option(BUILD_TESTS "Build unit tests" FALSE)

cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME})

add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE)
Expand Down Expand Up @@ -80,7 +67,5 @@ cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}
INCLUDE include
NAMESPACE ${CMAKE_WORKSPACE_NAME}::)


if(BUILD_TESTS)
add_subdirectory(test)
endif()
include(CMTest)
cm_add_test_subdirectory(test)
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

include(CMTest)

cm_find_package(Boost REQUIRED COMPONENTS unit_test_framework)
find_package(Boost REQUIRED COMPONENTS unit_test_framework)

target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
Expand Down

0 comments on commit ed375cd

Please sign in to comment.