fix: Fix the add to SL. #402
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
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. | |
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml | |
name: Console Build | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- 'PB/**' | |
pull_request: | |
branches: [ "main" ] | |
paths: | |
- 'PB/**' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. | |
fail-fast: false | |
# Set up a matrix to run the following 3 configurations: | |
# 1. <Windows, Release, latest MSVC compiler toolchain on the default runner image, default generator> | |
# 2. <Linux, Release, latest GCC compiler toolchain on the default runner image, default generator> | |
# 3. <Linux, Release, latest Clang compiler toolchain on the default runner image, default generator> | |
# | |
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. | |
matrix: | |
os: [windows-latest] | |
build_type: [Release] | |
c_compiler: [clang, cl] | |
include: | |
- os: windows-latest | |
c_compiler: cl | |
cpp_compiler: cl | |
exclude: | |
- os: windows-latest | |
c_compiler: clang | |
- os: macos-latest | |
c_compiler: cl | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set reusable strings | |
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. | |
id: strings | |
shell: bash | |
run: | | |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | |
- uses: lukka/get-cmake@latest | |
- name: run-vcpkg | |
uses: lukka/[email protected] | |
with: | |
# Specify the full SHA-1 hash of a Git commit (not a branch name, nor a tag!) that establishes which version of vcpkg needs to be used. When using vcpkg as a Git submodule, this input is *not* needed as implicitly specified by the submodule. | |
vcpkgGitCommitId: '9edb1b8e590cc086563301d735cae4b6e732d2d2' | |
# Run the installation of packages by running `vcpkg install` on the directory of the discovered 'vcpkg.json' file. Default is false. | |
runVcpkgInstall: true | |
# Enable the caching of the vcpkg executable and its data files (e.g. ports) by setting it to false. Default is true. Set this input to false when the vcpkg's executable is not delivered as a prebuilt file upon bootstrapping vcpkg. This does not disable vcpkg's binary cache which is always on and can be controlled by the user with the env var VCPKG_BINARY_SOURCES. | |
doNotCache: false | |
# Specify the glob expression used to discover the vcpkg.json whose content's hash is added to the cache key. On Windows runners using `github.workspace` context to form the expression would not work as expected since it contains backslashes. Use instead `**/path/to/vcpkg.json` to match the desired `vcpkg.json` file. | |
vcpkgJsonGlob: '**/windows/vcpkg.json' | |
- name: vcpkg install | |
run: vcpkg\vcpkg.exe install boost-program-options:x64-windows opencv:x64-windows boost-uuid:x64-windows expat:x64-windows brotli:x64-windows inih:x64-windows magic-enum:x64-windows exiv2:x64-windows gtest:x64-windows dp-thread-pool:x64-windows libharu:x64-windows sqlite3:x64-windows nlohmann-json:x64-windows boost-bimap:x64-windows | |
- name: vcpkg integrate install | |
run: vcpkg\vcpkg.exe integrate install | |
- name: Configure CMake (Windows) | |
if: matrix.os == 'windows-latest' | |
uses: lukka/run-cmake@v10 | |
with: | |
# This is the default path to the CMakeLists.txt along side the | |
# CMakePresets.json. Change if you need have CMakeLists.txt and CMakePresets.json | |
# located elsewhere. | |
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' | |
# This is the name of the CMakePresets.json's configuration to use to generate | |
# the project files. This configuration leverages the vcpkg.cmake toolchain file to | |
# run vcpkg and install all dependencies specified in vcpkg.json. | |
configurePreset: 'pb-console-debug' | |
- name: Build | |
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). | |
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} | |
- name: Generate test data | |
run: python PB\test-data\generate-data.py PB\test-data | |
- name: Test | |
working-directory: ${{ github.workspace }}\PB\build\Debug | |
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). | |
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
run: ctest --build-config ${{ matrix.build_type }} |