diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index dac3cca..cc2883f 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -30,16 +30,28 @@ jobs: compiler: clang - os: ubuntu-latest compiler: msvc + include: + - compiler: gcc + generator: Ninja + cppstd: gnu20 + libcxx: libstdc++ + compiler_version: 11 + - compiler: clang + generator: Ninja + cppstd: gnu20 + libcxx: libc++ + compiler_version: 14 + - compiler: msvc + generator: Visual Studio 17 2022 + cppstd: 20 + compiler_runtime: dynamic + compiler_version: 194 steps: - uses: actions/checkout@v4 - - 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" + - if: ${{ matrix.compiler == 'clang' }} + run: sudo apt-get update; sudo apt-get install clang - name: Install Conan id: conan @@ -57,64 +69,41 @@ jobs: restore-keys: conan-cache-${{ runner.os }}- - uses: DamianReeves/write-file-action@master - if: ${{ matrix.compiler == 'clang' }} with: path: ${{ env.CONAN_HOME }}/profiles/default contents: | [settings] arch=x86_64 - build_type=Release - compiler=clang - compiler.cppstd=gnu20 - compiler.libcxx=libc++ - compiler.version=14 - os=Linux - [conf] - tools.system.package_manager:mode=install - tools.system.package_manager:sudo=True + build_type=${{ matrix.build_type }} + compiler=${{ matrix.compiler }} + compiler.cppstd=${{ matrix.cppstd }} + compiler.libcxx=${{ matrix.libcxx }} + compiler.version=${{ matrix.compiler_version }} + compiler.runtime=${{ matrix.compiler_runtime }} + os=${{ runner.os }} write-mode: overwrite - uses: DamianReeves/write-file-action@master - if: ${{ matrix.compiler == 'gcc' }} + if: ${{ matrix.os == 'ubuntu-latest' }} with: path: ${{ env.CONAN_HOME }}/profiles/default contents: | - [settings] - arch=x86_64 - build_type=Release - compiler=gcc - compiler.cppstd=gnu20 - compiler.libcxx=libstdc++11 - compiler.version=11 - os=Linux [conf] tools.system.package_manager:mode=install tools.system.package_manager:sudo=True - write-mode: overwrite + write-mode: append - - uses: DamianReeves/write-file-action@master - if: ${{ matrix.compiler == 'msvc' }} - with: - path: ${{ env.CONAN_HOME }}/profiles/default - contents: | - [settings] - arch=x86_64 - build_type=Release - compiler=msvc - compiler.cppstd=20 - compiler.runtime=dynamic - compiler.version=194 - os=Windows - write-mode: overwrite - name: PrintProfile run: cat ${{ env.CONAN_HOME }}/profiles/default + - name: Install Dependencies + run: conan install . --build=missing --output-folder=build + - name: Build - run: conan create . --build=missing + run: > + cmake -G ${{ matrix.generator }} -S . -B build -DCMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + cmake --build build --config ${{ matrix.build_type }} --parallel - name: Test - working-directory: ${{ steps.strings.outputs.build-output-dir }} - # 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 }} + run: ctest --build-config ${{ matrix.build_type }} --test-dir build