-
Notifications
You must be signed in to change notification settings - Fork 0
Testing CPP library update #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
5b6aeea
Testing CPP library update
sean-parent a5c3e35
Merged
sean-parent 634a650
Simplifying installation test.
sean-parent 0193284
Updating library templates and version.
sean-parent 131405d
Updating to fix Windows quoting issue.
sean-parent 399d509
Trying again to fix quote issue.
sean-parent f2923f6
Testing latest cpp-library.
sean-parent 0c3fc51
Another test.
sean-parent 4e99dad
Update CI workflow to conditionally run steps
sean-parent 7cf4b7c
Update stlab/cpp-library dependency version
sean-parent 695b637
Update stlab/cpp-library to latest commit
sean-parent 49254eb
Update CMakeLists.txt
sean-parent 59d55c1
Regerate ci template.
sean-parent 09a264e
Update CI workflow and cpp-library dependency
sean-parent 4081373
Update project name and dependency references
sean-parent 809d3c3
Update CI workflow and cpp-library dependency
sean-parent d212a13
Making cache default setting more robust.
sean-parent 05f1be7
Update CMake config and CI, improve example test
sean-parent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,21 +13,23 @@ on: | |
|
|
||
| jobs: | ||
| test: | ||
| name: Test (${{ matrix.name }}) | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||
| compiler: [gcc, clang, msvc] | ||
| exclude: | ||
| - os: ubuntu-latest | ||
| compiler: msvc | ||
| - os: macos-latest | ||
| compiler: msvc | ||
| - os: macos-latest | ||
| compiler: gcc | ||
| - os: windows-latest | ||
| compiler: gcc | ||
| - os: windows-latest | ||
| compiler: clang | ||
| include: | ||
| - name: Ubuntu GCC | ||
| os: ubuntu-latest | ||
| cc: gcc | ||
| cxx: g++ | ||
| - name: Ubuntu Clang | ||
| os: ubuntu-latest | ||
| cc: clang | ||
| cxx: clang++ | ||
| - name: macOS | ||
| os: macos-latest | ||
| - name: Windows | ||
| os: windows-latest | ||
|
|
||
| runs-on: ${{ matrix.os }} | ||
|
|
||
|
|
@@ -36,18 +38,66 @@ jobs: | |
|
|
||
| - name: Configure CMake | ||
| run: cmake --preset=test | ||
| env: | ||
| CC: ${{ matrix.cc }} | ||
| CXX: ${{ matrix.cxx }} | ||
| if: ${{ matrix.cc }} | ||
|
|
||
| - name: Configure CMake | ||
| run: cmake --preset=test | ||
| if: ${{ !matrix.cc }} | ||
|
|
||
| - name: Build | ||
| run: cmake --build --preset=test | ||
|
|
||
| - name: Test | ||
| run: ctest --preset=test | ||
|
|
||
| - name: Build and Install | ||
| run: | | ||
| cmake --preset=default | ||
| cmake --build --preset=default | ||
| cmake --install build/default --prefix ${{ runner.temp }}/install | ||
sean-parent marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| env: | ||
| CC: ${{ matrix.cc }} | ||
| CXX: ${{ matrix.cxx }} | ||
| if: ${{ matrix.cc }} | ||
|
|
||
| - name: Build and Install | ||
| run: | | ||
| cmake --preset=default | ||
| cmake --build --preset=default | ||
| cmake --install build/default --prefix ${{ runner.temp }}/install | ||
| if: ${{ !matrix.cc }} | ||
|
|
||
| - name: Test find_package | ||
| shell: bash | ||
| run: | | ||
| # Create a minimal test to verify the installation works with find_package | ||
| mkdir -p ${{ runner.temp }}/test-find-package | ||
| cd ${{ runner.temp }}/test-find-package | ||
|
|
||
| # Create test CMakeLists.txt | ||
| cat > CMakeLists.txt << EOF | ||
| cmake_minimum_required(VERSION 3.20) | ||
| project(test-find-package CXX) | ||
|
|
||
| find_package(stlab-enum-ops REQUIRED) | ||
|
|
||
| message(STATUS "Successfully found stlab-enum-ops") | ||
sean-parent marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| EOF | ||
|
|
||
| # Convert paths to forward slashes for CMake (works on all platforms) | ||
| INSTALL_PREFIX=$(echo '${{ runner.temp }}/install' | sed 's|\\|/|g') | ||
|
|
||
| # Test find_package with CMAKE_PREFIX_PATH | ||
| cmake -B build -S . -DCMAKE_PREFIX_PATH="${INSTALL_PREFIX}" | ||
|
|
||
| clang-tidy: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Configure CMake with clang-tidy | ||
| run: cmake --preset=clang-tidy | ||
|
|
@@ -67,10 +117,11 @@ jobs: | |
| contents: read | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| # ssciwr/[email protected] | ||
| - name: Install Doxygen | ||
| uses: ssciwr/doxygen-install@v1 | ||
| uses: ssciwr/doxygen-install@501e53b879da7648ab392ee226f5b90e42148449 | ||
|
|
||
| - name: Configure CMake | ||
| run: cmake --preset=docs | ||
|
|
||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,7 @@ | ||
| { | ||
| "_comment": "Auto-generated from cpp-library (https://github.com/stlab/cpp-library) - Do not edit this file directly", | ||
| "recommendations": [ | ||
| "matepek.vscode-catch2-test-adapter", | ||
| "llvm-vs-code-extensions.vscode-clangd", | ||
| "ms-vscode.live-server", | ||
| "xaver.clang-format" | ||
| "ms-vscode.live-server" | ||
| ] | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,26 @@ | ||
| cmake_minimum_required(VERSION 3.20) | ||
| cmake_minimum_required(VERSION 3.24) | ||
|
|
||
| # Project declaration - cpp_library_setup will use this name and detect version from git tags | ||
| project(stlab-enum-ops) | ||
|
|
||
| # Setup cpp-library infrastructure | ||
| if(PROJECT_IS_TOP_LEVEL) | ||
| set(CPM_SOURCE_CACHE ${CMAKE_SOURCE_DIR}/.cache/cpm CACHE PATH "CPM cache") | ||
| endif() | ||
| include(cmake/CPM.cmake) | ||
|
|
||
| # Fetch cpp-library via CPM | ||
|
|
||
| # https://github.com/stlab/cpp-library/releases | ||
| # Fetch cpp-library before project() | ||
| # Check https://github.com/stlab/cpp-library/releases for the latest version | ||
| # CPMAddPackage( | ||
| # NAME cpp-library | ||
| # URL "${CMAKE_SOURCE_DIR}/../cpp-library" | ||
| # SOURCE_DIR "${CMAKE_SOURCE_DIR}/../cpp-library" | ||
| # ) | ||
| CPMAddPackage("gh:stlab/[email protected]") | ||
| # CPMAddPackage("gh:stlab/cpp-library#65dbed9fff9a0331355bd51dc1e8156262390154") | ||
| CPMAddPackage("gh:stlab/[email protected]") | ||
| include(${cpp-library_SOURCE_DIR}/cpp-library.cmake) | ||
|
|
||
| # Enable dependency tracking before project() | ||
| cpp_library_enable_dependency_tracking() | ||
|
|
||
| # Now declare project | ||
| project(enum-ops) | ||
|
|
||
| # Enable CTest infrastructure (required for tests/examples to work) | ||
| include(CTest) | ||
|
|
||
| # Let cpp-library handle the project declaration and version detection | ||
| cpp_library_setup( | ||
| DESCRIPTION "Type-safe operators for enums" | ||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.