Skip to content

Commit

Permalink
Fix macos CI build
Browse files Browse the repository at this point in the history
Use all_verify_interface_header_sets on CI too.
  • Loading branch information
ClausKlein committed Nov 10, 2024
1 parent 42b2fe0 commit ebde17f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
preset-test:
runs-on: ubuntu-latest # 22.04
runs-on: ubuntu-latest
strategy:
matrix:
preset: ["gcc-debug", "gcc-release"]
Expand Down Expand Up @@ -54,6 +54,7 @@ jobs:
cmake_args:
description: "Werror"
cmake_args: "-DCMAKE_CXX_FLAGS='-Werror=all -Werror=extra'"
# NOTE: This example is an header only library!
# - platform: ubuntu-22.04
# compiler:
# cpp: g++
Expand All @@ -63,7 +64,7 @@ jobs:
# description: "Dynamic"
# cmake_args: "-DBUILD_SHARED_LIBS=on"

name: "Bulid & Test on ${{ matrix.platform }}: ${{ matrix.compiler.c }} ${{ matrix.cpp_version }} ${{ matrix.cmake_args.description }}"
name: "Test on ${{ matrix.platform }}: ${{ matrix.compiler.c }} ${{ matrix.cpp_version }} ${{ matrix.cmake_args.description }}"
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
Expand All @@ -74,31 +75,41 @@ jobs:
ninjaVersion: "^1.11.1"
- name: Print installed softwares
run: |
clang++ --version
g++ --version
${{ matrix.compiler.cpp }} --version || ${CXX} --version || echo ignored
${{ matrix.compiler.c }} --version || ${CC} --version || echo ignored
cmake --version
ninja --version
- name: Configure CMake on macos with clang
if: startsWith(matrix.compiler.c, 'clang') && startsWith(matrix.platform, 'macos')
run: |
CC=$(brew --prefix llvm@18)/bin/clang CXX=$(brew --prefix llvm@18)/bin/clang++ cmake -B build -S . "-DCMAKE_CXX_STANDARD=${{ matrix.cpp_version }} ${{ matrix.cmake_args.args }}"
env:
CMAKE_GENERATOR: "Ninja Multi-Config"

- name: Configure CMake
if: ( startsWith(matrix.compiler.c, 'gcc') || startsWith(matrix.platform, 'ubuntu') ) || ( startsWith(matrix.compiler.c, 'gcc') && startsWith(matrix.platform, 'macos') )
run: |
cmake -B build -S . "-DCMAKE_CXX_STANDARD=${{ matrix.cpp_version }} ${{ matrix.cmake_args.args }}"
env:
CC: ${{ matrix.compiler.c }}
CXX: ${{ matrix.compiler.cpp }}
CMAKE_GENERATOR: "Ninja Multi-Config"

- name: Build Release
run: |
cmake --build build --config Release --verbose
cmake --build build --config Release --target all_verify_interface_header_sets
cmake --install build --config Release --prefix /opt/beman.exemplar
find /opt/beman.exemplar -type f
cmake --install build --config Release --prefix /tmp/beman.exemplar
find /tmp/beman.exemplar -type f
- name: Test Release
run: ctest --test-dir build --build-config Release
- name: Build Debug
run: |
cmake --build build --config Debug --verbose
cmake --build build --config Debug --target all_verify_interface_header_sets
cmake --install build --config Debug --prefix /opt/beman.exemplar
find /opt/beman.exemplar -type f
cmake --install build --config Debug --prefix /tmp/beman.exemplar
find /tmp/beman.exemplar -type f
- name: Test Debug
run: ctest --test-dir build --build-config Debug

Expand Down
6 changes: 5 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@
},
{
"name": "gcc-release",
"configurePreset": "gcc-release"
"configurePreset": "gcc-release",
"targets": [
"all_verify_interface_header_sets",
"all"
]
}
],
"testPresets": [
Expand Down
2 changes: 0 additions & 2 deletions src/beman/exemplar/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
add_library(beman.exemplar INTERFACE)
add_library(beman::exemplar ALIAS beman.exemplar)

# XXX target_sources(beman.exemplar PRIVATE identity.cpp)

target_sources(
beman.exemplar
PUBLIC
Expand Down

0 comments on commit ebde17f

Please sign in to comment.