minor fixes for clang-tidy and doc #82
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'CMake macOS' | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
env: | |
# https://github.com/Mozilla-Actions/sccache-action | |
SCCACHE_GHA_ENABLED: "true" | |
# 3GB; 10GB total for 4 compile jobs and conan data | |
SCCACHE_CACHE_SIZE : 3G | |
jobs: | |
# Note: [GHA Default environment variables](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables) | |
macOS: | |
name: macOS ${{ matrix.cmake.configure_preset }} | |
runs-on: ${{ matrix.image }} | |
# if: false # always skip job | |
strategy: | |
fail-fast: false | |
matrix: | |
image: [ macos-15 ] | |
os: [ macos ] | |
cmake: | |
- { | |
compiler: "clang++", | |
conan_profile: "clang", | |
configure_preset: "clang", | |
build_preset: "clang-release", | |
test_preset: "clang-release-test" | |
} | |
steps: | |
- name: Trigger event | |
run: | | |
echo "Triggered by ${{ github.event_name }}" | |
- name: Install required build dependencies on ${{ matrix.image }} | |
# https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md | |
run: | | |
brew update | |
brew install ninja pipx | |
# set the path to homebrew's LLVM | |
echo "$(brew --prefix llvm@18)/bin" >> $GITHUB_PATH | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set Github runner's env (CXX=${{ matrix.cmake.compiler }}) | |
run: | | |
echo "CXX=${{ matrix.cmake.compiler }}" >> $GITHUB_ENV | |
- name: Install conan package manager | |
id: conan2 | |
# cope with [PEP 668 – Marking Python base environments as “externally managed”]( | |
# https://peps.python.org/pep-0668/). | |
run: | | |
pipx install virtualenv conan | |
- name: Cache Conan2 dependencies | |
id: conan2-cache | |
uses: actions/cache@v4 | |
with: | |
key: ${{ matrix.os }}-${{ matrix.cmake.conan_profile }}-conan-${{ hashFiles('conanfile.py') }} | |
path: | | |
~/.conan2 | |
- name: Create Conan2 profile (default, ${{ matrix.cmake.conan_profile }}) | |
if: ${{ steps.conan2-cache.outputs.cache-hit != 'true' }} | |
run: | | |
conan profile detect --force --name ${{ matrix.cmake.conan_profile }} | |
cp ~/.conan2/profiles/${{ matrix.cmake.conan_profile }} ~/.conan2/profiles/default | |
conan profile show -pr=${{ matrix.cmake.conan_profile }} | |
- name: Setup Github cache for compiler cache (Mozilla sccache-cache) | |
uses: mozilla-actions/[email protected] | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
- name: Show CMake configure and build pre-conditions | |
if: false | |
shell: bash | |
run: | | |
env | |
echo $HOME | |
- name: Conan install | |
run: | | |
virtualenv .venv | |
source .venv/bin/activate | |
pip install multipledispatch | |
python3 conan_install.py --profile ${{ matrix.cmake.conan_profile }} | |
deactivate | |
- name: CMake configuration | |
env: | |
CMAKE_CXX_COMPILER_LAUNCHER: sccache | |
run: | | |
conan list '*' | |
cmake --list-presets | |
cmake --preset ${{ matrix.cmake.configure_preset }} | |
- name: CMake build | |
run: | | |
cmake --build --preset ${{ matrix.cmake.build_preset }} | |
- name: Run Unit Test | |
continue-on-error: true | |
run: | | |
ctest --preset ${{ matrix.cmake.test_preset }} |