Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add git to aarch64 container in CI #652

Merged
merged 10 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
- '**.md'
- 'docs/**'

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -22,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
shared: [ON, OFF]
shared: [OFF]
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: uraimo/run-on-arch-action@v2
Expand All @@ -33,11 +36,11 @@ jobs:
with:
arch: aarch64
githubToken: ${{ github.token }}
distro: ubuntu_latest
distro: ubuntu22.04
install: |
apt-get update -q -y
apt-get install -y cmake make g++ ninja-build
apt-get install -y cmake make g++ ninja-build git
run: |
cmake -DADA_SANITIZE=ON -DADA_DEVELOPMENT_CHECKS=ON -DBUILD_SHARED_LIBS=${{matrix.shared}} -G Ninja -B build
cmake --build build -j=2
cmake -DADA_SANITIZE_BOUNDS_STRICT=ON -DBUILD_SHARED_LIBS=${{matrix.shared}} -B build
cmake --build build
ctest --test-dir build
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ if(ADA_TESTING OR ADA_BENCHMARKS OR ADA_TOOLS)

if (ADA_TESTING AND NOT EMSCRIPTEN)
if(Git_FOUND)
set(CTEST_TEST_TIMEOUT 5)
message(STATUS "The tests are enabled.")
add_subdirectory(tests)
else()
Expand Down
5 changes: 4 additions & 1 deletion cmake/ada-flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ option(ADA_SANITIZE_UNDEFINED "Sanitize undefined behaviour" OFF)
if(ADA_SANITIZE)
message(STATUS "Address sanitizer enabled.")
endif()
if(ADA_SANITIZE_WITHOUT_LEAKS)
message(STATUS "Address sanitizer (but not leak) enabled.")
endif()
if(ADA_SANITIZE_UNDEFINED)
message(STATUS "Undefined sanitizer enabled.")
endif()
Expand Down Expand Up @@ -35,7 +38,7 @@ if (ADA_COVERAGE)
endif()

if (NOT CMAKE_BUILD_TYPE)
if(ADA_SANITIZE OR ADA_SANITIZE_BOUNDS_STRICT OR ADA_SANITIZE_UNDEFINED)
if(ADA_SANITIZE OR ADA_SANITIZE_WITHOUT_LEAKS OR ADA_SANITIZE_BOUNDS_STRICT OR ADA_SANITIZE_UNDEFINED)
message(STATUS "No build type selected, default to Debug because you have sanitizers.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
else()
Expand Down
3 changes: 3 additions & 0 deletions cmake/add-cpp-test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ function(add_cpp_test TEST_NAME)
add_compile_options(-fsanitize=address -fno-omit-frame-pointer -fno-sanitize-recover=all)
add_compile_definitions(ASAN_OPTIONS=detect_leaks=1)
endif()
if(ADA_SANITIZE_WITHOUT_LEAKS)
add_compile_options(-fsanitize=address -fno-omit-frame-pointer -fno-sanitize-recover=all)
endif()
if(ADA_SANITIZE_BOUNDS_STRICT)
add_compile_options(-fsanitize=bounds-strict -fno-sanitize-recover=all)
add_link_options(-fsanitize=bounds-strict)
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ if(ADA_SANITIZE)
target_compile_definitions(ada INTERFACE ASAN_OPTIONS=detect_leaks=1)
target_link_libraries(ada INTERFACE -fsanitize=address -fno-omit-frame-pointer -fno-sanitize-recover=all)
endif()
if(ADA_SANITIZE_WITHOUT_LEAKS)
target_compile_options(ada INTERFACE -fsanitize=address -fno-omit-frame-pointer -fno-sanitize-recover=all)
target_link_libraries(ada INTERFACE -fsanitize=address -fno-omit-frame-pointer -fno-sanitize-recover=all)
endif()

if(ADA_LOGGING)
target_compile_definitions(ada PRIVATE ADA_LOGGING=1)
Expand Down
12 changes: 6 additions & 6 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ else()
target_link_libraries(ada_c PRIVATE simdjson GTest::gtest_main)
target_link_libraries(url_search_params PRIVATE simdjson GTest::gtest_main)

gtest_discover_tests(wpt_tests)
gtest_discover_tests(url_components)
gtest_discover_tests(basic_tests)
gtest_discover_tests(from_file_tests)
gtest_discover_tests(ada_c)
gtest_discover_tests(url_search_params)
gtest_discover_tests(wpt_tests PROPERTIES TEST_DISCOVERY_TIMEOUT 600)
gtest_discover_tests(url_components PROPERTIES TEST_DISCOVERY_TIMEOUT 600)
gtest_discover_tests(basic_tests PROPERTIES TEST_DISCOVERY_TIMEOUT 600)
gtest_discover_tests(from_file_tests PROPERTIES TEST_DISCOVERY_TIMEOUT 600)
gtest_discover_tests(ada_c PROPERTIES TEST_DISCOVERY_TIMEOUT 600)
gtest_discover_tests(url_search_params PROPERTIES TEST_DISCOVERY_TIMEOUT 600)

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9)
Expand Down
Loading