Skip to content

Commit 52978d3

Browse files
committed
fix: run ctest as part of conan build
1 parent 120b1d6 commit 52978d3

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

.github/workflows/conan.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,6 @@ jobs:
4444
conan remote list
4545
conan profile show
4646
47-
- name: Build the client with conan
47+
- name: Build the client with conan and run tests
4848
run: |
4949
conan build . --profile=.conan/profiles/${{ matrix.profile }}.conanprofile -s build_type=${{ matrix.build_type }}
50-
51-
- name: Run tests
52-
shell: bash
53-
run: |
54-
cd build
55-
if [ -d ${{ matrix.build_type }} ]; then
56-
cd ${{ matrix.build_type }}
57-
fi
58-
ctest --output-on-failure -C ${{ matrix.build_type }}

conanfile.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from conan import ConanFile
2+
from conan.tools.build import can_run
23
from conan.tools.cmake import cmake_layout, CMake
34

45
class ClientRecipe(ConanFile):
@@ -47,7 +48,7 @@ def layout(self):
4748

4849
def build(self):
4950
cmake = CMake(self)
50-
#cmake.configure(None, None, ["--trace"])
5151
cmake.configure()
52-
#cmake.build(None, None, ["--verbose"])
53-
cmake.build()
52+
cmake.build()
53+
if can_run(self):
54+
cmake.ctest()

0 commit comments

Comments
 (0)