File tree Expand file tree Collapse file tree 4 files changed +30
-21
lines changed
Expand file tree Collapse file tree 4 files changed +30
-21
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ name: build
55
66on :
77 push :
8+ branches :
9+ - master
810 pull_request :
11+ branches :
12+ - master
913 workflow_dispatch :
1014
1115permissions :
@@ -22,12 +26,26 @@ jobs:
2226 steps :
2327 - uses : actions/checkout@v4
2428
29+ - name : Cache test assets
30+ uses : actions/cache@v4
31+ with :
32+ path : build/teaklite2_tests_result.bin
33+ enableCrossOsArchive : true
34+ key : ' baffcd4f805a7480d969401792443a34aa39f813b4f0ae49c6365f1d1f3ce120'
35+
36+ - name : Download test assets
37+ if : " !hashFiles('build/teaklite2_tests_result.bin')"
38+ run : |
39+ git lfs pull --exclude='' --include='*'
40+ mkdir -p build
41+ mv src/test_verifier/data/teaklite2_tests_result.bin build/teaklite2_tests_result.bin
42+
2543 - name : Configure
26- run : cmake -B build
44+ run : cmake -B build -DCMAKE_BUILD_TYPE=Debug -DTEAKRA_RUN_TESTS=ON -DTEAKRA_TEST_ASSETS_DIR="$PWD/build"
2745
2846 - name : Build
29- run : cmake --build build --parallel
47+ run : cmake --build build --config Debug -- parallel
3048
3149 - name : Test
3250 working-directory : build
33- run : ctest --verbose
51+ run : ctest --build-config Debug -- verbose
Original file line number Diff line number Diff line change 1+ [lfs]
2+ fetchexclude = *
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
8282find_package (Threads REQUIRED )
8383
8484if (NOT TEAKRA_TEST_ASSETS_DIR)
85- set (TEAKRA_TEST_ASSETS_DIR "${CMAKE_CURRENT_BINARY_DIR} " )
85+ set (TEAKRA_TEST_ASSETS_DIR "${PROJECT_SOURCE_DIR} /src/test_verifier/data " )
8686endif ()
8787
8888# External libraries
Original file line number Diff line number Diff line change @@ -14,24 +14,13 @@ target_compile_options(test_verifier PRIVATE ${TEAKRA_CXX_FLAGS})
1414set (ASSET_SHA256SUM "baffcd4f805a7480d969401792443a34aa39f813b4f0ae49c6365f1d1f3ce120" )
1515if (TEAKRA_RUN_TESTS)
1616 message (STATUS "Will run Teakra accuracy tests" )
17- # download fixtures if there is none
18- if (NOT EXISTS "${TEAKRA_TEST_ASSETS_DIR} /teaklite2_tests_result" )
19- message (STATUS "Downloading required samples..." )
20- file (DOWNLOAD
21- "https://liushuyu.b-cdn.net/teaklite2_tests_result_20181208"
22- "${TEAKRA_TEST_ASSETS_DIR} /teaklite2_tests_result"
23- EXPECTED_HASH SHA256=${ASSET_SHA256SUM}
24- SHOW_PROGRESS
25- )
17+ # check if provided fixtures are good
18+ file (SHA256 "${TEAKRA_TEST_ASSETS_DIR} /teaklite2_tests_result.bin" ASSET_CHECKSUM )
19+ if (ASSET_SHA256SUM STREQUAL ASSET_CHECKSUM)
20+ message (STATUS "Unit test sample looks good." )
2621 else ()
27- # check if provided fixtures are good
28- file (SHA256 "${TEAKRA_TEST_ASSETS_DIR} /teaklite2_tests_result" ASSET_CHECKSUM )
29- if (ASSET_SHA256SUM STREQUAL ASSET_CHECKSUM)
30- message (STATUS "Unit test sample looks good." )
31- else ()
32- message (FATAL_ERROR "Unit test sample broken. Please remove the file and re-run CMake." )
33- endif ()
22+ message (FATAL_ERROR "Unit test sample broken. Please download the file using: git lfs pull --exclude='' --include='*'" )
3423 endif ()
3524
36- add_test (NAME tests COMMAND test_verifier "${TEAKRA_TEST_ASSETS_DIR} /teaklite2_tests_result" )
25+ add_test (NAME tests COMMAND test_verifier "${TEAKRA_TEST_ASSETS_DIR} /teaklite2_tests_result.bin " )
3726endif (TEAKRA_RUN_TESTS )
You can’t perform that action at this time.
0 commit comments