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 62e56de commit 595c538
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 24 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,32 @@ concurrency:
jobs:
handle-syncwith:
name: Call Reusable SyncWith Handler
uses: NilFoundation/ci-cd/.github/workflows/reusable-handle-syncwith.yml@v1.2.0
uses: NilFoundation/ci-cd/.github/workflows/reusable-handle-syncwith.yml@v1.2.1
with:
ci-cd-ref: 'v1.2.0'
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@fc033b4fe60244ce95b240adf18a0623961cb9d5
uses: NilFoundation/crypto3/.github/workflows/reusable-submodule-testing-linux.yml@1bd56b12f410f3f1a4891076705a9261a6b1efaa

secrets: inherit
with:
submodules-refs: ${{ needs.handle-syncwith.outputs.prs-refs }}
check-names: |
block-clang
# Temporarily disable mac tests, they fail.
# test-mac:
# name: Mac Reusable Crypto3 Testing
# needs:
# - handle-syncwith
# uses: NilFoundation/crypto3/.github/workflows/reusable-submodule-testing-mac.yml@fc033b4fe60244ce95b240adf18a0623961cb9d5
# uses: NilFoundation/crypto3/.github/workflows/reusable-submodule-testing-mac.yml@ede1d6b903078a0aa48a6864ba465b66af4fda8b

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

publish-results:
name: Publish JUnit results
needs:
- test-linux
# - test-mac
uses: NilFoundation/crypto3/.github/workflows/reusable-publish-result.yml@fc033b4fe60244ce95b240adf18a0623961cb9d5
30 changes: 30 additions & 0 deletions .github/workflows/set_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Set version

on:
# Triggers the workflow on push to master branch
push:
branches: [ master ]

jobs:
set_version:
name: Set and tag version
runs-on: [ubuntu-latest]
env:
VERSION_FILE_NAME: VERSION
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set version
id: set_version
run: |
version=$(cat ${{ env.VERSION_FILE_NAME }} | tr -d '\r').$GITHUB_RUN_NUMBER
echo "VERSION=$version" >> $GITHUB_ENV
- name: Tag new version
run: git tag v${{ env.VERSION }}

- name: Push tags
uses: ad-m/github-push-action@master
with:
tags: true
12 changes: 1 addition & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,8 @@ endif()

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

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

if((NOT Boost_CONTAINER_FOUND OR NOT Boost_FOUND) AND NOT CMAKE_CROSSCOMPILING)
cm_find_package(Boost COMPONENTS REQUIRED container)
find_package(Boost COMPONENTS REQUIRED container)
endif()

include(TargetArchitecture)
Expand All @@ -46,8 +38,6 @@ include(PlatformConfiguration)
include(CheckSSE)
include(CheckAVX)

option(BUILD_TESTS "Build unit tests" FALSE)

option(${CMAKE_UPPER_WORKSPACE_NAME}_${CURRENT_UPPER_PROJECT_NAME}_AES
"Build with AES block encryption support" TRUE)
option(${CMAKE_UPPER_WORKSPACE_NAME}_${CURRENT_UPPER_PROJECT_NAME}_ARIA
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#---------------------------------------------------------------------------#

if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND)
cm_find_package(Boost REQUIRED COMPONENTS unit_test_framework)
find_package(Boost REQUIRED COMPONENTS unit_test_framework)
endif()

cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}
Expand Down

0 comments on commit 595c538

Please sign in to comment.