Skip to content

Commit 256d0e7

Browse files
committed
Simplify CI workflow to use only Ubuntu and update test names
The CI workflow now runs unit tests only on ubuntu-latest instead of a matrix of OSes. Test project and header names were updated from 'test' to 'mylib' for consistency, and related CMake and file references were adjusted accordingly.
1 parent da92c05 commit 256d0e7

1 file changed

Lines changed: 9 additions & 20 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,8 @@ on:
1010

1111
jobs:
1212
unit-tests:
13-
name: Unit Tests (${{ matrix.name }})
14-
strategy:
15-
fail-fast: false
16-
matrix:
17-
include:
18-
- name: Ubuntu
19-
os: ubuntu-latest
20-
- name: macOS
21-
os: macos-latest
22-
- name: Windows
23-
os: windows-latest
24-
25-
runs-on: ${{ matrix.os }}
13+
name: Unit Tests
14+
runs-on: ubuntu-latest
2615

2716
steps:
2817
- uses: actions/checkout@v5
@@ -50,7 +39,7 @@ jobs:
5039
# Create CMakeLists.txt that uses cpp-library
5140
cat > CMakeLists.txt << 'EOF'
5241
cmake_minimum_required(VERSION 3.20)
53-
project(test VERSION 1.0.0)
42+
project(mylib VERSION 1.0.0)
5443
5544
include(../cmake/CPM.cmake)
5645
CPMAddPackage(NAME cpp-library SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
@@ -60,12 +49,12 @@ jobs:
6049
cpp_library_setup(
6150
DESCRIPTION "Test library for cpp-library"
6251
NAMESPACE testlib
63-
HEADERS test.hpp
52+
HEADERS mylib.hpp
6453
)
6554
EOF
6655
6756
# Create a simple header
68-
cat > include/testlib/test.hpp << 'EOF'
57+
cat > include/testlib/mylib.hpp << 'EOF'
6958
#pragma once
7059
namespace testlib {
7160
inline int get_value() { return 42; }
@@ -90,7 +79,7 @@ jobs:
9079
- name: Verify installation
9180
run: |
9281
# Check that package config was installed
93-
if [ ! -f "${{ runner.temp }}/install/lib/cmake/testlib-test/testlib-testConfig.cmake" ]; then
82+
if [ ! -f "${{ runner.temp }}/install/lib/cmake/testlib-mylib/testlib-mylibConfig.cmake" ]; then
9483
echo "Error: Package config not found"
9584
exit 1
9685
fi
@@ -106,15 +95,15 @@ jobs:
10695
cmake_minimum_required(VERSION 3.20)
10796
project(test-consumer)
10897
109-
find_package(testlib-test REQUIRED)
98+
find_package(testlib-mylib REQUIRED)
11099
111100
add_executable(consumer main.cpp)
112-
target_link_libraries(consumer PRIVATE testlib::test)
101+
target_link_libraries(consumer PRIVATE testlib::mylib)
113102
EOF
114103
115104
# Create main.cpp
116105
cat > main.cpp << 'EOF'
117-
#include <testlib/test.hpp>
106+
#include <testlib/mylib.hpp>
118107
#include <iostream>
119108
int main() {
120109
std::cout << "Value: " << testlib::get_value() << std::endl;

0 commit comments

Comments
 (0)