Skip to content

Commit

Permalink
Merge pull request #4 from ZIMO-Elektronik/fix_ci
Browse files Browse the repository at this point in the history
ci: add ppa:ubuntu-toolchain-r/test
  • Loading branch information
higaski authored May 18, 2024
2 parents e3040c7 + d42ff8a commit 62c5e92
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on:

jobs:
arm-none-eabi-gcc:
uses: ZIMO-Elektronik/.github-workflows/.github/workflows/arm-none-eabi-gcc.yml@v0.0.1
uses: ZIMO-Elektronik/.github-workflows/.github/workflows/arm-none-eabi-gcc.yml@v0.0.6
with:
arch: -mcpu=cortex-m4
target: Salsa20

x86_64-linux-gnu-gcc:
uses: ZIMO-Elektronik/.github-workflows/.github/workflows/x86_64-linux-gnu-gcc.yml@v0.0.1
uses: ZIMO-Elektronik/.github-workflows/.github/workflows/x86_64-linux-gnu-gcc.yml@v0.0.6
6 changes: 5 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ on:

jobs:
tests:
uses: ZIMO-Elektronik/.github-workflows/.github/workflows/ctest.yml@v0.0.1
uses: ZIMO-Elektronik/.github-workflows/.github/workflows/x86_64-linux-gnu-gcc.yml@v0.0.6
with:
args: -DCMAKE_BUILD_TYPE=Debug
target: Salsa20Tests
post-build: ctest --test-dir build --schedule-random --timeout 86400
12 changes: 5 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ include(FetchContent)

FetchContent_Declare(
CMakeModules
GIT_REPOSITORY https://github.com/ZIMO-Elektronik/CMakeModules.git
GIT_TAG v0.2.1
GIT_REPOSITORY "https://github.com/ZIMO-Elektronik/CMakeModules.git"
GIT_TAG v0.9.1
SOURCE_DIR ${CMAKE_BINARY_DIR}/CMakeModules)
FetchContent_MakeAvailable(CMakeModules)

Expand All @@ -17,7 +17,7 @@ project(
add_library(Salsa20 STATIC src/salsa20.c)
add_library(Salsa20::Salsa20 ALIAS Salsa20)

if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
if(PROJECT_IS_TOP_LEVEL)
target_include_directories(
Salsa20
INTERFACE include
Expand All @@ -29,12 +29,10 @@ else()
PRIVATE include/salsa20)
endif()

if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
if(PROJECT_IS_TOP_LEVEL)
include(CTest)
endif()

if(BUILD_TESTING
AND CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME
AND CMAKE_SYSTEM_NAME STREQUAL CMAKE_HOST_SYSTEM_NAME)
if(BUILD_TESTING AND CMAKE_SYSTEM_NAME STREQUAL CMAKE_HOST_SYSTEM_NAME)
add_subdirectory(tests)
endif()
17 changes: 11 additions & 6 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@ include(GoogleTest)
file(GLOB_RECURSE SRC *.c *.cpp)
add_executable(Salsa20Tests ${SRC})

sanitize("address,undefined")
sanitize(address,undefined)

target_common_warnings(Salsa20Tests PRIVATE)

FetchContent_Declare(
cpmaddpackage(
NAME
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG main
GIT_PROGRESS TRUE)
FetchContent_MakeAvailable(googletest)
GITHUB_REPOSITORY
"google/googletest"
GIT_TAG
main
SYSTEM
YES
OPTIONS
"INSTALL_GTEST OFF")

find_package(OpenSSL REQUIRED)
target_link_libraries(
Expand Down

0 comments on commit 62c5e92

Please sign in to comment.