Skip to content

Commit 9d004ef

Browse files
committed
Update CI infrastructure
1 parent e5f6c4b commit 9d004ef

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

.github/workflows/run_cpp_tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ name: C++ tests
22

33
on:
44
push:
5+
branches: [main, dev]
56
pull_request:
7+
branches: [main]
68

79
jobs:
810
build:
@@ -17,7 +19,7 @@ jobs:
1719
steps:
1820
- uses: actions/checkout@v4
1921

20-
- name: Install dependencies
22+
- name: Install Catch2
2123
run: |
2224
git clone https://github.com/catchorg/Catch2.git
2325
cd Catch2
@@ -37,5 +39,5 @@ jobs:
3739
3840
- name: Run tests
3941
run: |
40-
cd build/tests
42+
cd build
4143
ctest -C Release --output-on-failure --verbose

CMakeLists.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@ set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-g -Og -Wall -Wextra")
1919
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -Wextra")
2020
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-O3 -Wall -Wextra")
2121

22-
if(NOT DEFINED BUILD_MEX)
23-
set(BUILD_MEX True)
24-
endif()
22+
# Build MEX interface.
23+
option(BUILD_MEX "Build MEX interface" True)
2524
if (BUILD_MEX)
2625
add_subdirectory("mex")
2726
endif()
2827

29-
if(NOT DEFINED BUILD_TESTS)
30-
set(BUILD_TESTS False)
31-
endif()
28+
# Build tests.
29+
option(BUILD_TESTS "Run Catch2 tests" False)
3230
if (BUILD_TESTS)
31+
enable_testing()
3332
add_subdirectory("tests")
3433
endif()

0 commit comments

Comments
 (0)