Skip to content

Commit afa83d3

Browse files
committed
wip
1 parent 1bf99a7 commit afa83d3

File tree

4 files changed

+128
-65
lines changed

4 files changed

+128
-65
lines changed

.github/workflows/linux.yml

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,28 @@ jobs:
3131
- name: Install external dependencies
3232
run: micromamba install -n build_env -y -f ./environment-dev.yml
3333

34-
- name: Build sparrow-ipc
34+
- name: Configure using cmake
3535
run: |
36-
cmake -B build/ -G Ninja \
37-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
38-
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
39-
-DSPARROW_IPC_BUILD_SHARED=${{ matrix.build_shared }} \
40-
-DSPARROW_IPC_BUILD_TESTS=ON
41-
cmake --build build/ --parallel
36+
cmake -G Ninja \
37+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
38+
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX% \
39+
-DCMAKE_PREFIX_PATH=%CONDA_PREFIX% \
40+
-DSPARROW_IPC_BUILD_SHARED=${{ matrix.build_shared }} \
41+
-DSPARROW_IPC_BUILD_TESTS=ON \
42+
-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING
43+
44+
- name: Build sparrow-ipc
45+
working-directory: build
46+
run: cmake --build . --config ${{matrix.build_type}} --target sparrow-ipc
47+
48+
- name: Build tests
49+
working-directory: build
50+
run: cmake --build . --config ${{matrix.config}} --target test_sparrow_ipc_lib
4251

4352
- name: Run tests
44-
run: |
45-
cd build
46-
ctest --output-on-failure
53+
working-directory: build
54+
run: cmake --build . --config ${{matrix.config}} --target run_tests_with_junit_report
55+
4756

4857
linux_build_fetch_from_source:
4958
runs-on: ubuntu-latest
@@ -55,16 +64,22 @@ jobs:
5564
- name: Checkout repository
5665
uses: actions/checkout@v4
5766

58-
- name: Build sparrow-ipc
67+
- name: Configure using cmake
5968
run: |
60-
cmake -B build/ -G Ninja \
61-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
62-
-DSPARROW_IPC_BUILD_SHARED=${{ matrix.build_shared }} \
63-
-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING \
64-
-DSPARROW_IPC_BUILD_TESTS=ON
65-
cmake --build build/ --parallel
66-
69+
cmake -G Ninja \
70+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
71+
-DSPARROW_IPC_BUILD_SHARED=${{ matrix.build_shared }} \
72+
-DSPARROW_IPC_BUILD_TESTS=ON \
73+
-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING
74+
75+
- name: Build sparrow-ipc
76+
working-directory: build
77+
run: cmake --build . --config ${{matrix.build_type}} --target sparrow-ipc
78+
79+
- name: Build tests
80+
working-directory: build
81+
run: cmake --build . --config ${{matrix.config}} --target test_sparrow_ipc_lib
82+
6783
- name: Run tests
68-
run: |
69-
cd build
70-
ctest --output-on-failure
84+
working-directory: build
85+
run: cmake --build . --config ${{matrix.config}} --target run_tests_with_junit_report

.github/workflows/osx.yml

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,27 @@ jobs:
2828
environment-name: build_env
2929
cache-environment: true
3030

31-
- name: Install external dependencies
32-
run: micromamba install -n build_env -y -f ./environment-dev.yml
31+
- name: Configure using cmake
32+
run: |
33+
cmake -G Ninja \
34+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
35+
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX% \
36+
-DCMAKE_PREFIX_PATH=%CONDA_PREFIX% \
37+
-DSPARROW_IPC_BUILD_SHARED=${{ matrix.build_shared }} \
38+
-DSPARROW_IPC_BUILD_TESTS=ON
3339
3440
- name: Build sparrow-ipc
35-
run: |
36-
cmake -B build/ -G Ninja \
37-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
38-
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
39-
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
40-
-DSPARROW_IPC_BUILD_SHARED=${{ matrix.build_shared }} \
41-
-DSPARROW_IPC_BUILD_TESTS=ON
42-
cmake --build build/ --parallel
43-
41+
working-directory: build
42+
run: cmake --build . --config ${{matrix.build_type}} --target sparrow-ipc
43+
44+
- name: Build tests
45+
working-directory: build
46+
run: cmake --build . --config ${{matrix.config}} --target test_sparrow_ipc_lib
47+
4448
- name: Run tests
45-
run: |
46-
cd build
47-
ctest --output-on-failure
49+
working-directory: build
50+
run: cmake --build . --config ${{matrix.config}} --target run_tests_with_junit_report
51+
4852

4953
osx_build_fetch_from_source:
5054
runs-on: macos-latest
@@ -56,16 +60,23 @@ jobs:
5660
- name: Checkout repository
5761
uses: actions/checkout@v4
5862

59-
- name: Build sparrow-ipc
63+
- name: Configure using cmake
6064
run: |
61-
cmake -B build/ -G Ninja \
62-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
63-
-DSPARROW_IPC_BUILD_SHARED=${{ matrix.build_shared }} \
64-
-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING \
65-
-DSPARROW_IPC_BUILD_TESTS=ON
66-
cmake --build build/ --parallel
65+
cmake -G Ninja \
66+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
67+
-DSPARROW_IPC_BUILD_SHARED=${{ matrix.build_shared }} \
68+
-DSPARROW_IPC_BUILD_TESTS=ON \
69+
-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING
70+
71+
- name: Build sparrow-ipc
72+
working-directory: build
73+
run: cmake --build . --config ${{matrix.build_type}} --target sparrow-ipc
74+
75+
- name: Build tests
76+
working-directory: build
77+
run: cmake --build . --config ${{matrix.config}} --target test_sparrow_ipc_lib
6778

6879
- name: Run tests
69-
run: |
70-
cd build
71-
ctest --output-on-failure
80+
working-directory: build
81+
run: cmake --build . --config ${{matrix.config}} --target run_tests_with_junit_report
82+

.github/workflows/windows.yml

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,28 @@ jobs:
3030
cache-environment: true
3131
init-shell: cmd.exe
3232

33-
- name: Install external dependencies
34-
run: micromamba install -n build_env -y -f ./environment-dev.yml
33+
- name: Configure using cmake
34+
run: |
35+
cmake -G Ninja \
36+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
37+
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX% \
38+
-DCMAKE_PREFIX_PATH=%CONDA_PREFIX% \
39+
-DSPARROW_IPC_BUILD_SHARED=${{ matrix.build_shared }} \
40+
-DSPARROW_IPC_BUILD_TESTS=ON
3541
3642
- name: Build sparrow-ipc
43+
working-directory: build
44+
run: cmake --build . --config ${{matrix.build_type}} --target sparrow-ipc
45+
46+
- name: Build tests
47+
working-directory: build
48+
run: cmake --build . --config ${{matrix.config}} --target test_sparrow_ipc_lib
49+
50+
- name: Run tests
51+
working-directory: build
3752
run: |
38-
cmake -B build/ -G Ninja ^
39-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ^
40-
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX% ^
41-
-DCMAKE_PREFIX_PATH=%CONDA_PREFIX% ^
42-
-DSPARROW_IPC_BUILD_SHARED=${{ matrix.build_shared }} ^
43-
-DSPARROW_IPC_BUILD_TESTS=ON
44-
if %errorlevel% neq 0 exit /b %errorlevel%
45-
cmake --build build/ --parallel
46-
if %errorlevel% neq 0 exit /b %errorlevel%
53+
cmake --build . --config ${{matrix.config}} --target run_tests
54+
4755
4856
windows_build_fetch_from_source:
4957
runs-on: windows-latest
@@ -55,13 +63,22 @@ jobs:
5563
- name: Checkout repository
5664
uses: actions/checkout@v4
5765

58-
- name: Build sparrow-ipc
66+
- name: Configure using cmake
5967
run: |
60-
cmake -B build/ -G Ninja ^
61-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ^
62-
-DSPARROW_IPC_BUILD_SHARED=${{ matrix.build_shared }} ^
63-
-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING ^
64-
-DSPARROW_IPC_BUILD_TESTS=ON
65-
if %errorlevel% neq 0 exit /b %errorlevel%
66-
cmake --build build/ --parallel
67-
if %errorlevel% neq 0 exit /b %errorlevel%
68+
cmake -G Ninja \
69+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
70+
-DSPARROW_IPC_BUILD_SHARED=${{ matrix.build_shared }} \
71+
-DSPARROW_IPC_BUILD_TESTS=ON \
72+
-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING
73+
74+
- name: Build sparrow-ipc
75+
working-directory: build
76+
run: cmake --build . --config ${{matrix.build_type}} --target sparrow-ipc
77+
78+
- name: Build tests
79+
working-directory: build
80+
run: cmake --build . --config ${{matrix.config}} --target test_sparrow_ipc_lib
81+
82+
- name: Run tests
83+
working-directory: build
84+
run: cmake --build . --config ${{matrix.config}} --target run_tests_with_junit_report

tests/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,23 @@ target_include_directories(${test_target}
1414
)
1515
add_dependencies(${test_target} generate_flatbuffers_headers)
1616
add_test(NAME sparrow-ipc-tests COMMAND ${test_target})
17+
18+
add_custom_target(run_tests
19+
COMMAND ${test_target}
20+
DEPENDS
21+
${test_target}
22+
COMMENT "Running tests"
23+
USES_TERMINAL
24+
)
25+
26+
set_target_properties(run_tests PROPERTIES FOLDER "Tests utilities")
27+
28+
set(JUNIT_REPORT_FILE_DOCTEST ${CMAKE_CURRENT_BINARY_DIR}/test_sparrow-ipc_lib_report_doctest.xml)
29+
30+
add_custom_target(run_tests_with_junit_report
31+
COMMAND ${test_target} --reporters=junit --out=${JUNIT_REPORT_FILE_DOCTEST} --no-path-filenames=true # TODO: use better junit as in sparrow
32+
DEPENDS
33+
${test_target}
34+
COMMENT "Running tests with JUnit reports saved to: ${JUNIT_REPORT_FILE_DOCTEST}"
35+
USES_TERMINAL
36+
)

0 commit comments

Comments
 (0)