Rewrite using C++ standard library implementations #64
Workflow file for this run
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
| name: skyr-url CI | |
| # Trigger on pushes to all branches and for all pull-requests | |
| on: [ push, pull_request ] | |
| env: | |
| CMAKE_VERSION: 3.21.7 | |
| NINJA_VERSION: 1.11.0 | |
| jobs: | |
| build: | |
| name: ${{ matrix.config.name }} | |
| runs-on: ${{ matrix.config.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| # GCC-13 (C++23) | |
| - { | |
| name: "Linux GCC 13 Debug (C++23)", artifact: "Linux.tar.xz", | |
| os: ubuntu-24.04, | |
| build_type: Debug, | |
| cc: "gcc-13", cxx: "g++-13", | |
| cxx_standard: 23 | |
| } | |
| - { | |
| name: "Linux GCC 13 Release (C++23)", artifact: "Linux.tar.xz", | |
| os: ubuntu-24.04, | |
| build_type: RelWithDebInfo, | |
| cc: "gcc-13", cxx: "g++-13", | |
| cxx_standard: 23 | |
| } | |
| # GCC-14 (C++23) | |
| - { | |
| name: "Linux GCC 14 Debug (C++23)", artifact: "Linux.tar.xz", | |
| os: ubuntu-24.04, | |
| build_type: Debug, | |
| cc: "gcc-14", cxx: "g++-14", | |
| cxx_standard: 23 | |
| } | |
| - { | |
| name: "Linux GCC 14 Release (C++23)", artifact: "Linux.tar.xz", | |
| os: ubuntu-24.04, | |
| build_type: RelWithDebInfo, | |
| cc: "gcc-14", cxx: "g++-14", | |
| cxx_standard: 23 | |
| } | |
| # Clang-17 (C++23) | |
| - { | |
| name: "Linux Clang 17 Debug (C++23)", artifact: "Linux.tar.xz", | |
| os: ubuntu-24.04, | |
| build_type: Debug, | |
| cc: "clang-17", cxx: "clang++-17", | |
| cxx_standard: 23 | |
| } | |
| - { | |
| name: "Linux Clang 17 Release (C++23)", artifact: "Linux.tar.xz", | |
| os: ubuntu-24.04, | |
| build_type: RelWithDebInfo, | |
| cc: "clang-17", cxx: "clang++-17", | |
| cxx_standard: 23 | |
| } | |
| # Clang-18 (C++23) | |
| - { | |
| name: "Linux Clang 18 Debug (C++23)", artifact: "Linux.tar.xz", | |
| os: ubuntu-24.04, | |
| build_type: Debug, | |
| cc: "clang-18", cxx: "clang++-18", | |
| cxx_standard: 23 | |
| } | |
| - { | |
| name: "Linux Clang 18 Release (C++23)", artifact: "Linux.tar.xz", | |
| os: ubuntu-24.04, | |
| build_type: RelWithDebInfo, | |
| cc: "clang-18", cxx: "clang++-18", | |
| cxx_standard: 23 | |
| } | |
| # AppleClang (C++23) | |
| - { | |
| name: "macOS Clang Debug (C++23)", artifact: "macOS.tar.xz", | |
| os: macos-latest, | |
| build_type: Debug, | |
| cc: "clang", cxx: "clang++", | |
| cxx_standard: 23 | |
| } | |
| - { | |
| name: "macOS Clang Release (C++23)", artifact: "macOS.tar.xz", | |
| os: macos-latest, | |
| build_type: RelWithDebInfo, | |
| cc: "clang", cxx: "clang++", | |
| cxx_standard: 23 | |
| } | |
| # MSVC 2022 (C++23) | |
| - { | |
| name: "Windows MSVC 2022 Debug (C++23)", artifact: "Windows-MSVC.tar.xz", | |
| os: windows-latest, | |
| build_type: Debug, | |
| cc: "cl", cxx: "cl", | |
| environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat", | |
| cxx_standard: 23 | |
| } | |
| - { | |
| name: "Windows MSVC 2022 Release (C++23)", artifact: "Windows-MSVC.tar.xz", | |
| os: windows-latest, | |
| build_type: RelWithDebInfo, | |
| cc: "cl", cxx: "cl", | |
| environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat", | |
| cxx_standard: 23 | |
| } | |
| steps: | |
| - uses: actions/checkout@master | |
| - uses: seanmiddleditch/gha-setup-vsdevenv@master | |
| - name: Download Ninja and CMake | |
| id: cmake_and_ninja | |
| shell: cmake -P {0} | |
| run: | | |
| set(cmake_version $ENV{CMAKE_VERSION}) | |
| set(ninja_version $ENV{NINJA_VERSION}) | |
| message(STATUS "Using host CMake version: ${CMAKE_VERSION}") | |
| if ("${{ runner.os }}" STREQUAL "Windows") | |
| set(ninja_suffix "win.zip") | |
| set(cmake_suffix "windows-x86_64.zip") | |
| set(cmake_dir "cmake-${cmake_version}-windows-x86_64/bin") | |
| elseif ("${{ runner.os }}" STREQUAL "Linux") | |
| set(ninja_suffix "linux.zip") | |
| set(cmake_suffix "linux-x86_64.tar.gz") | |
| set(cmake_dir "cmake-${cmake_version}-linux-x86_64/bin") | |
| elseif ("${{ runner.os }}" STREQUAL "macOS") | |
| set(ninja_suffix "mac.zip") | |
| set(cmake_suffix "macos10.10-universal.tar.gz") | |
| set(cmake_dir "cmake-${cmake_version}-macos10.10-universal/CMake.app/Contents/bin") | |
| endif() | |
| set(ninja_url "https://github.com/ninja-build/ninja/releases/download/v${ninja_version}/ninja-${ninja_suffix}") | |
| file(DOWNLOAD "${ninja_url}" ./ninja.zip SHOW_PROGRESS) | |
| execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ninja.zip) | |
| set(cmake_url "https://github.com/Kitware/CMake/releases/download/v${cmake_version}/cmake-${cmake_version}-${cmake_suffix}") | |
| file(DOWNLOAD "${cmake_url}" ./cmake.zip SHOW_PROGRESS) | |
| execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./cmake.zip) | |
| # Save the path for other steps | |
| file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/${cmake_dir}" cmake_dir) | |
| message("::set-output name=cmake_dir::${cmake_dir}") | |
| execute_process( | |
| COMMAND chmod +x ninja | |
| COMMAND chmod +x ${cmake_dir}/cmake | |
| ) | |
| - name: Install GCC 13 | |
| id: install_gcc_13 | |
| if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-13' ) | |
| shell: bash | |
| working-directory: ${{ env.HOME }} | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get -y install g++-13 | |
| - name: Install GCC 14 | |
| id: install_gcc_14 | |
| if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-14' ) | |
| shell: bash | |
| working-directory: ${{ env.HOME }} | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get -y install g++-14 | |
| - name: Install Clang 17 | |
| id: install_clang_17 | |
| if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-17' ) | |
| shell: bash | |
| working-directory: ${{ env.HOME }} | |
| run: | | |
| wget https://apt.llvm.org/llvm.sh | |
| chmod +x llvm.sh | |
| sudo ./llvm.sh 17 | |
| sudo apt-get install -y libc++-17-dev libc++abi-17-dev | |
| - name: Install Clang 18 | |
| id: install_clang_18 | |
| if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-18' ) | |
| shell: bash | |
| working-directory: ${{ env.HOME }} | |
| run: | | |
| wget https://apt.llvm.org/llvm.sh | |
| chmod +x llvm.sh | |
| sudo ./llvm.sh 18 | |
| sudo apt-get install -y libc++-18-dev libc++abi-18-dev | |
| - name: Install vcpkg (Linux) | |
| id: vcpkg_linux | |
| if: startsWith(matrix.config.os, 'ubuntu') | |
| shell: bash | |
| run: | | |
| mkdir -p ${GITHUB_WORKSPACE}/vcpkg | |
| cd ${GITHUB_WORKSPACE}/vcpkg | |
| git init | |
| git remote add origin https://github.com/microsoft/vcpkg.git | |
| git fetch origin master | |
| git checkout -b master origin/master | |
| export | |
| ./bootstrap-vcpkg.sh | |
| ./vcpkg install catch2 uni-algo nlohmann-json | |
| - name: Install vcpkg (MacOS) | |
| id: vcpkg_macos | |
| if: startsWith(matrix.config.os, 'macos') | |
| shell: bash | |
| run: | | |
| brew install pkg-config | |
| mkdir -p ${GITHUB_WORKSPACE}/vcpkg | |
| cd ${GITHUB_WORKSPACE}/vcpkg | |
| git init | |
| git remote add origin https://github.com/microsoft/vcpkg.git | |
| git fetch origin master | |
| git checkout -b master origin/master | |
| export | |
| ./bootstrap-vcpkg.sh | |
| ./vcpkg install catch2 uni-algo nlohmann-json | |
| - name: Install vcpkg (Windows) | |
| id: vcpkg_windows | |
| if: startsWith(matrix.config.os, 'windows') | |
| shell: powershell | |
| run: | | |
| git clone https://github.com/microsoft/vcpkg.git ${Env:GITHUB_WORKSPACE}\vcpkg | |
| cd ${Env:GITHUB_WORKSPACE}\vcpkg | |
| .\bootstrap-vcpkg.bat | |
| vcpkg install catch2 uni-algo nlohmann-json --triplet x64-windows | |
| - name: Configure | |
| shell: cmake -P {0} | |
| working-directory: ${{ env.HOME }} | |
| run: | | |
| set(ENV{CC} ${{ matrix.config.cc }}) | |
| set(ENV{CXX} ${{ matrix.config.cxx }}) | |
| if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x") | |
| execute_process( | |
| COMMAND "${{ matrix.config.environment_script }}" && set | |
| OUTPUT_FILE environment_script_output.txt | |
| ) | |
| set(cxx_flags "/permissive- /EHsc") | |
| file(STRINGS environment_script_output.txt output_lines) | |
| foreach(line IN LISTS output_lines) | |
| if (line MATCHES "^([a-zA-Z0-9_-]+)=(.*)$") | |
| set(ENV{${CMAKE_MATCH_1}} "${CMAKE_MATCH_2}") | |
| endif() | |
| endforeach() | |
| endif() | |
| set(path_separator ":") | |
| if ("${{ runner.os }}" STREQUAL "Windows") | |
| set(path_separator ";") | |
| endif() | |
| set(ENV{PATH} "$ENV{GITHUB_WORKSPACE}${path_separator}$ENV{PATH}") | |
| # Determine if we should use LLVM libc++ (for Linux Clang builds) | |
| set(USE_LLVM OFF) | |
| if(startsWith("${{ matrix.config.os }}", "ubuntu") AND | |
| startsWith("${{ matrix.config.cxx }}", "clang++")) | |
| set(USE_LLVM ON) | |
| endif() | |
| execute_process( | |
| COMMAND ${{ steps.cmake_and_ninja.outputs.cmake_dir }}/cmake | |
| -S . | |
| -B build | |
| -G Ninja | |
| -D CMAKE_CXX_STANDARD:STRING=${{ matrix.config.cxx_standard }} | |
| -D skyr_WARNINGS_AS_ERRORS=OFF | |
| -D skyr_BUILD_TESTS=ON | |
| -D skyr_BUILD_DOCS=OFF | |
| -D skyr_BUILD_EXAMPLES=OFF | |
| -D skyr_BUILD_WITH_LLVM_LIBCXX=${USE_LLVM} | |
| -D CMAKE_BUILD_TYPE=${{ matrix.config.build_type }} | |
| -D CMAKE_INSTALL_PREFIX=$ENV{GITHUB_WORKSPACE}/install | |
| -D CMAKE_TOOLCHAIN_FILE=$ENV{GITHUB_WORKSPACE}/vcpkg/scripts/buildsystems/vcpkg.cmake | |
| RESULT_VARIABLE result | |
| ) | |
| if (NOT result EQUAL 0) | |
| message(FATAL_ERROR "Bad exit status") | |
| endif() | |
| - name: Build | |
| shell: cmake -P {0} | |
| working-directory: ${{ env.HOME }} | |
| continue-on-error: ${{ matrix.config.experimental || false }} | |
| run: | | |
| set(ENV{NINJA_STATUS} "[%f/%t %o/sec] ") | |
| if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x") | |
| file(STRINGS environment_script_output.txt output_lines) | |
| foreach(line IN LISTS output_lines) | |
| if (line MATCHES "^([a-zA-Z0-9_-]+)=(.*)$") | |
| set(ENV{${CMAKE_MATCH_1}} "${CMAKE_MATCH_2}") | |
| endif() | |
| endforeach() | |
| endif() | |
| set(path_separator ":") | |
| if ("${{ runner.os }}" STREQUAL "Windows") | |
| set(path_separator ";") | |
| endif() | |
| set(ENV{PATH} "$ENV{GITHUB_WORKSPACE}${path_separator}$ENV{PATH}") | |
| execute_process( | |
| COMMAND ${{ steps.cmake_and_ninja.outputs.cmake_dir }}/cmake --build build | |
| RESULT_VARIABLE result | |
| ) | |
| if (NOT result EQUAL 0) | |
| message(FATAL_ERROR "Bad exit status") | |
| endif() | |
| - name: Run tests | |
| shell: cmake -P {0} | |
| working-directory: ${{ env.HOME }} | |
| continue-on-error: ${{ matrix.config.experimental || false }} | |
| run: | | |
| include(ProcessorCount) | |
| ProcessorCount(N) | |
| set(ENV{CTEST_OUTPUT_ON_FAILURE} "ON") | |
| execute_process( | |
| COMMAND ${{ steps.cmake_and_ninja.outputs.cmake_dir }}/cmake --build build --target test | |
| RESULT_VARIABLE result | |
| ) | |
| if (NOT result EQUAL 0) | |
| message(FATAL_ERROR "Running tests failed!") | |
| endif() | |
| - name: Install | |
| shell: cmake -P {0} | |
| working-directory: ${{ env.HOME }} | |
| continue-on-error: ${{ matrix.config.experimental || false }} | |
| run: | | |
| execute_process( | |
| COMMAND ${{ steps.cmake_and_ninja.outputs.cmake_dir }}/cmake --build build --target install | |
| RESULT_VARIABLE result | |
| ) | |
| if (NOT result EQUAL 0) | |
| message(FATAL_ERROR "Install failed!") | |
| endif() |