Skip to content

Commit e927f5b

Browse files
committed
Update ci.yml
1 parent b2d8e3c commit e927f5b

File tree

1 file changed

+20
-15
lines changed
  • templates/.github/workflows

1 file changed

+20
-15
lines changed

templates/.github/workflows/ci.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,23 @@ on:
1313

1414
jobs:
1515
test:
16+
name: Test (${{ matrix.name }})
1617
strategy:
18+
fail-fast: false
1719
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
3133

3234
runs-on: ${{ matrix.os }}
3335

@@ -36,6 +38,9 @@ jobs:
3638

3739
- name: Configure CMake
3840
run: cmake --preset=test
41+
env:
42+
CC: ${{ matrix.cc }}
43+
CXX: ${{ matrix.cxx }}
3944

4045
- name: Build
4146
run: cmake --build --preset=test
@@ -68,8 +73,8 @@ jobs:
6873
mkdir -p ${{ runner.temp }}/test-find-package
6974
cd ${{ runner.temp }}/test-find-package
7075
71-
# Get project name from CMakeLists.txt
72-
PACKAGE_NAME=$(grep -m1 "project(" "${{ github.workspace }}/CMakeLists.txt" | sed 's/project(\([^)]*\)).*/\1/' | awk '{print $1}')
76+
# Get project name from CMakeLists.txt (handles multi-line project() declarations)
77+
PACKAGE_NAME=$(sed -n '/project(/,/)/p' "${{ github.workspace }}/CMakeLists.txt" | tr '\n' ' ' | sed 's/.*project([ \t]*\([^ \t)]*\).*/\1/')
7378
7479
# Convert paths to forward slashes for CMake (works on all platforms)
7580
INSTALL_PREFIX=$(echo "${{ runner.temp }}/install" | sed 's|\\|/|g')

0 commit comments

Comments
 (0)