|
13 | 13 |
|
14 | 14 | jobs: |
15 | 15 | test: |
| 16 | + name: Test (${{ matrix.name }}) |
16 | 17 | strategy: |
| 18 | + fail-fast: false |
17 | 19 | matrix: |
18 | | - os: [ubuntu-latest, macos-latest, windows-latest] |
19 | | - compiler: [gcc, clang, msvc] |
20 | | - exclude: |
21 | | - - os: ubuntu-latest |
22 | | - compiler: msvc |
23 | | - - os: macos-latest |
24 | | - compiler: msvc |
25 | | - - os: macos-latest |
26 | | - compiler: gcc |
27 | | - - os: windows-latest |
28 | | - compiler: gcc |
29 | | - - os: windows-latest |
30 | | - compiler: clang |
| 20 | + include: |
| 21 | + - name: Ubuntu GCC |
| 22 | + os: ubuntu-latest |
| 23 | + cc: gcc |
| 24 | + cxx: g++ |
| 25 | + - name: Ubuntu Clang |
| 26 | + os: ubuntu-latest |
| 27 | + cc: clang |
| 28 | + cxx: clang++ |
| 29 | + - name: macOS |
| 30 | + os: macos-latest |
| 31 | + - name: Windows |
| 32 | + os: windows-latest |
31 | 33 |
|
32 | 34 | runs-on: ${{ matrix.os }} |
33 | 35 |
|
|
36 | 38 |
|
37 | 39 | - name: Configure CMake |
38 | 40 | run: cmake --preset=test |
| 41 | + env: |
| 42 | + CC: ${{ matrix.cc }} |
| 43 | + CXX: ${{ matrix.cxx }} |
39 | 44 |
|
40 | 45 | - name: Build |
41 | 46 | run: cmake --build --preset=test |
@@ -68,25 +73,21 @@ jobs: |
68 | 73 | mkdir -p ${{ runner.temp }}/test-find-package |
69 | 74 | cd ${{ runner.temp }}/test-find-package |
70 | 75 |
|
71 | | - # Get project name from CMakeLists.txt |
72 | | - PACKAGE_NAME=$(grep -m1 "project(" "${{ github.workspace }}/CMakeLists.txt" | sed 's/project(\([^)]*\)).*/\1/' | awk '{print $1}') |
73 | | -
|
74 | | - # Convert paths to forward slashes for CMake (works on all platforms) |
75 | | - INSTALL_PREFIX=$(echo "${{ runner.temp }}/install" | sed 's|\\|/|g') |
76 | | -
|
77 | 76 | # Create test CMakeLists.txt |
78 | 77 | cat > CMakeLists.txt << EOF |
79 | 78 | cmake_minimum_required(VERSION 3.20) |
80 | 79 | project(test-find-package CXX) |
81 | 80 |
|
82 | | - set(CMAKE_PREFIX_PATH "${INSTALL_PREFIX}") |
83 | | - find_package(${PACKAGE_NAME} REQUIRED) |
| 81 | + find_package(stlab-enum-ops REQUIRED) |
84 | 82 |
|
85 | | - message(STATUS "Successfully found ${PACKAGE_NAME}") |
| 83 | + message(STATUS "Successfully found stlab-enum-ops") |
86 | 84 | EOF |
87 | 85 |
|
88 | | - # Test find_package |
89 | | - cmake -B build -S . |
| 86 | + # Convert paths to forward slashes for CMake (works on all platforms) |
| 87 | + INSTALL_PREFIX=$(echo "${{ runner.temp }}/install" | sed 's|\\|/|g') |
| 88 | +
|
| 89 | + # Test find_package with CMAKE_PREFIX_PATH |
| 90 | + cmake -B build -S . -DCMAKE_PREFIX_PATH="${INSTALL_PREFIX}" |
90 | 91 |
|
91 | 92 | clang-tidy: |
92 | 93 | runs-on: ubuntu-latest |
|
0 commit comments