Skip to content

Commit 12509bb

Browse files
committed
test updates
1 parent 3ef5cba commit 12509bb

File tree

2 files changed

+17
-27
lines changed

2 files changed

+17
-27
lines changed

.github/workflows/cmake.yml

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,48 +8,38 @@ env:
88

99
jobs:
1010
build:
11-
# The CMake configure and build commands are platform agnostic and should work equally
12-
# well on Windows or Mac. You can convert this to a matrix build if you need
13-
# cross-platform coverage.
14-
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
1511
runs-on: ubuntu-latest
1612

1713
steps:
14+
# Checkout the repository
1815
- uses: actions/checkout@v2
1916

17+
# Checkout submodules if necessary
2018
- name: Checkout Submodules
21-
run: python3 $(pwd)/git_to_https.py .gitmodules && git submodule update --init && git submodule foreach --recursive python3 $(pwd)/git_to_https.py && git submodule update --init
19+
run: |
20+
python3 $(pwd)/git_to_https.py .gitmodules
21+
git submodule update --init
22+
git submodule foreach --recursive python3 $(pwd)/git_to_https.py
23+
git submodule update --init
2224
25+
# Create build directory (out-of-source build)
2326
- name: Create Build Environment
24-
# Some projects don't allow in-source building, so create a separate build directory
25-
# We'll use this as our working directory for all subsequent commands
26-
run: cmake -E make_directory ${{runner.workspace}}/build
27-
28-
- name: SetupLibs
29-
working-directory: ${{runner.workspace}}/build
30-
shell: bash
31-
# Execute the build. You can specify a specific target with "--target <NAME>"
32-
run: sudo apt-get install googletest && cd /usr/src/googletest && sudo cmake ./ && sudo make && sudo make install
27+
run: cmake -E make_directory ${{ runner.workspace }}/build
3328

29+
# Configure the CMake project
3430
- name: Configure CMake
35-
# Use a bash shell so we can use the same syntax for environment variable
36-
# access regardless of the host operating system
31+
working-directory: ${{ runner.workspace }}/build
3732
shell: bash
38-
working-directory: ${{runner.workspace}}/build
39-
# Note the current convention is to use the -S and -B options here to specify source
40-
# and build directories, but this is only available with CMake 3.13 and higher.
41-
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
4233
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
4334

35+
# Build the project using CMake
4436
- name: Build
45-
working-directory: ${{runner.workspace}}/build
37+
working-directory: ${{ runner.workspace }}/build
4638
shell: bash
47-
# Execute the build. You can specify a specific target with "--target <NAME>"
4839
run: cmake --build . --config $BUILD_TYPE
4940

41+
# Run tests defined by the CMake configuration
5042
- name: Test
51-
working-directory: ${{runner.workspace}}/build
43+
working-directory: ${{ runner.workspace }}/build
5244
shell: bash
53-
# Execute tests defined by the CMake configuration.
54-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
55-
run: ctest -C $BUILD_TYPE
45+
run: ctest -V -C $BUILD_TYPE

tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,4 +174,4 @@ message("System Path" ${CMAKE_SYSTEM_INCLUDE_PATH})
174174
# StaticAnalysis("${AnalyseFiles}" "./")
175175
#endif()
176176

177-
add_test(NAME tests COMMAND ${TargetName})
177+
add_test(NAME ${TargetName} COMMAND ${TargetName})

0 commit comments

Comments
 (0)