Squashed commit of the following: #80
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
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
types: [ "review_requested", "ready_for_review" ] | |
workflow_dispatch: | |
name: Build | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
name: ${{ matrix.config.name }} | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
matrix: | |
config: | |
- name: "Build on Linux" | |
os: ubuntu-latest | |
artifact: "Linux-x64" | |
conan-profile: conanprofile-linux.txt | |
conan-file: conanfile-linux.txt | |
env: | |
CC: gcc | |
CXX: g++ | |
- name: "Build on Windows" | |
os: windows-latest | |
artifact: "Windows-x64" | |
conan-profile: conanprofile-windows.txt | |
conan-file: conanfile-windows.txt | |
fail-fast: false | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: "Get Conan" | |
uses: turtlebrowser/get-conan@main | |
- name: "Setup Conan Settings (Linux)" | |
if: ${{ matrix.config.os == 'ubuntu-latest'}} | |
run: | | |
mv conansettings.yml settings_user.yml | |
conan config install settings_user.yml | |
- name: "Install Conan" | |
run: conan install ${{matrix.config.conan-file}} --profile:host=${{matrix.config.conan-profile}} --profile:build=${{matrix.config.conan-profile}} -s compiler.cppstd=20 --build=missing | |
- name: "CMake Build (Linux)" | |
if: ${{ matrix.config.os == 'ubuntu-latest'}} | |
working-directory: ${{github.workspace}}/build | |
run: | | |
cmake .. -DCMAKE_TOOLCHAIN_FILE="${{github.workspace}}/build/Release/generators/conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
cmake --build . | |
- name: "CMake Build (Windows)" | |
if: ${{ matrix.config.os == 'windows-latest'}} | |
working-directory: ${{github.workspace}}/build | |
run: | | |
cmake .. -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="${{github.workspace}}/build/generators/conan_toolchain.cmake" | |
cmake --build . --config ${{env.BUILD_TYPE}} | |
- name: "CMake Install" | |
working-directory: ${{github.workspace}}/build | |
run: cmake --install . --prefix "${{github.workspace}}/install" | |
- name: "CMake Test" | |
working-directory: ${{github.workspace}}/build | |
run: ctest | |
- name: Upload | |
uses: actions/upload-artifact@v1 | |
with: | |
path: ${{github.workspace}}/install | |
name: ${{matrix.config.artifact}}-${{env.BUILD_TYPE}} |