Skip to content

Commit 02e2ae7

Browse files
committed
fixed all target; refactored cmake to pull and build deps (more portable); updated workflow
1 parent 4de7a32 commit 02e2ae7

3 files changed

Lines changed: 17 additions & 15 deletions

File tree

.github/workflows/build-test-run.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ jobs:
1111
runs-on: ubuntu-latest
1212
container: darrylwest/ubuntu24-gpp1420:latest
1313

14+
strategy:
15+
matrix:
16+
build_type: [Debug, Release]
17+
1418
steps:
1519
- name: Checkout code
1620
uses: actions/checkout@v4
@@ -28,16 +32,6 @@ jobs:
2832
g++ --version
2933
cmake --version
3034
31-
- name: Install Catch2
32-
run: |
33-
git clone https://github.com/catchorg/Catch2.git
34-
cd Catch2
35-
git checkout v3.7.1
36-
cmake -B build -S . -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr/local
37-
cmake --build build --parallel $(nproc)
38-
cmake --build build --target install
39-
cd ..
40-
4135
- name: Configure CMake
4236
run: |
4337
cmake -B build \
@@ -62,5 +56,5 @@ jobs:
6256
6357
- name: Run
6458
run: |
65-
echo "=== Running simple-colors example ==="
59+
echo "=== Running tiny-app ==="
6660
${{github.workspace}}/build/tiny-app

CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,15 @@ CPMAddPackage(
5757
)
5858
message(STATUS "cpp-termio library loaded")
5959

60-
find_package(nlohmann_json 3.2.0 REQUIRED)
61-
find_package(Catch2 3 REQUIRED)
60+
CPMAddPackage(
61+
NAME nlohmann_json
62+
GITHUB_REPOSITORY nlohmann/json
63+
VERSION 3.11.3)
64+
65+
CPMAddPackage(
66+
NAME Catch2
67+
GITHUB_REPOSITORY CatchOrg/Catch2
68+
VERSION 3.6.0)
6269

6370
# MacOS universal binary setup
6471
if(APPLE)

mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ do
2929
shift
3030
;;
3131
all)
32-
./mk clobber init build unit
32+
./mk pull
33+
./mk clobber init test run
3334

3435
exit 0
3536
;;
@@ -47,7 +48,7 @@ do
4748
shift
4849
;;
4950
unit|test)
50-
# (cd build && time make $FLAGS)
51+
(cd build && time make $FLAGS)
5152
./build/unit_tests
5253

5354
shift

0 commit comments

Comments
 (0)