From 6f70267077ce6815770993cb62cbc4bc3facaad6 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Wed, 11 Jan 2023 16:47:00 +0700 Subject: [PATCH] separate `test` target into 2 for C and C++ --- .github/workflows/test.yml | 4 ++-- test/CMakeLists.txt | 3 ++- test/test.c | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 test/test.c diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e74dd59..2796c42 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,10 +49,10 @@ jobs: uses: ./ with: source-dir: test - targets: test + targets: test_c test_cpp - name: Run build result - run: build/test + run: build/test_c && build/test_cpp use-action-with-specified-compiler: runs-on: ubuntu-latest diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 813ceb9..617b4f1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -12,4 +12,5 @@ if(BUILD_CXX) add_executable(hello_world hello_world.cpp) endif() -add_executable(test EXCLUDE_FROM_ALL test.cpp) +add_executable(test_c EXCLUDE_FROM_ALL test.c) +add_executable(test_cpp EXCLUDE_FROM_ALL test.cpp) diff --git a/test/test.c b/test/test.c new file mode 100644 index 0000000..4cce7f6 --- /dev/null +++ b/test/test.c @@ -0,0 +1,3 @@ +int main() { + return 0; +}