Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit b363db3

Browse files
authored
feat: add unit tests CI (#1214)
* feat: add unit tests CI * fix: make * fix: more * fix: format
1 parent f576d41 commit b363db3

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

.github/workflows/cortex-cpp-quality-gate.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,26 @@ jobs:
2424
- os: "linux"
2525
name: "amd64"
2626
runs-on: "ubuntu-20-04-cuda-12-0"
27-
cmake-flags: "-DCORTEX_CPP_VERSION=${{github.event.pull_request.head.sha}} -DCMAKE_TOOLCHAIN_FILE=/home/runner/actions-runner/_work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake"
27+
cmake-flags: "-DCORTEX_CPP_VERSION=${{github.event.pull_request.head.sha}} -DCMAKE_BUILD_TEST=ON -DCMAKE_TOOLCHAIN_FILE=/home/runner/actions-runner/_work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake"
2828
build-deps-cmake-flags: ""
2929
ccache-dir: ''
3030
- os: "mac"
3131
name: "amd64"
3232
runs-on: "macos-13"
33-
cmake-flags: "-DCORTEX_CPP_VERSION=${{github.event.pull_request.head.sha}} -DCMAKE_TOOLCHAIN_FILE=/Users/runner/work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake"
33+
cmake-flags: "-DCORTEX_CPP_VERSION=${{github.event.pull_request.head.sha}} -DCMAKE_BUILD_TEST=ON -DCMAKE_TOOLCHAIN_FILE=/Users/runner/work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake"
3434
build-deps-cmake-flags: ""
3535
ccache-dir: ''
3636
- os: "mac"
3737
name: "arm64"
3838
runs-on: "macos-latest"
39-
cmake-flags: "-DCORTEX_CPP_VERSION=${{github.event.pull_request.head.sha}} -DMAC_ARM64=ON -DCMAKE_TOOLCHAIN_FILE=/Users/runner/work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake"
39+
cmake-flags: "-DCORTEX_CPP_VERSION=${{github.event.pull_request.head.sha}} -DCMAKE_BUILD_TEST=ON -DMAC_ARM64=ON -DCMAKE_TOOLCHAIN_FILE=/Users/runner/work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake"
4040
build-deps-cmake-flags: ""
4141
ccache-dir: ''
4242
- os: "windows"
4343
name: "amd64"
4444
runs-on: "windows-cuda-12-0"
45-
cmake-flags: "-DCORTEX_CPP_VERSION=${{github.event.pull_request.head.sha}} -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=C:/w/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja"
46-
build-deps-cmake-flags: "-DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja"
45+
cmake-flags: "-DCORTEX_CPP_VERSION=${{github.event.pull_request.head.sha}} -DCMAKE_BUILD_TEST=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=C:/w/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja"
46+
build-deps-cmake-flags: "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja"
4747
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
4848
steps:
4949
- name: Clone
@@ -78,7 +78,12 @@ jobs:
7878
run: |
7979
cd engine
8080
make build CMAKE_EXTRA_FLAGS="${{ matrix.cmake-flags }}" BUILD_DEPS_CMAKE_EXTRA_FLAGS="${{ matrix.build-deps-cmake-flags }}"
81-
81+
82+
- name: Run unit tests
83+
run: |
84+
cd engine
85+
make run-unit-tests
86+
8287
- name: Pre-package
8388
run: |
8489
cd engine

engine/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@ else
5353
make -j4;
5454
endif
5555

56+
run-unit-tests:
57+
ifeq ($(OS),Windows_NT)
58+
@powershell -Command "cd build\test\components\; .\test-components.exe;"
59+
else ifeq ($(shell uname -s),Linux)
60+
@cd build/test/components/;\
61+
./test-components
62+
else
63+
@cd build/test/components/;\
64+
./test-components
65+
endif
66+
67+
5668
pre-package:
5769
ifeq ($(OS),Windows_NT)
5870
@powershell -Command "mkdir -p cortex;"

0 commit comments

Comments
 (0)