diff --git a/.github/scripts/run-cmake-test b/.github/scripts/run-cmake-test deleted file mode 100755 index d5cae35e..00000000 --- a/.github/scripts/run-cmake-test +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -WORKSPACE=$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. && /bin/pwd -P) - -# Build with internal dependencies - -mkdir "${WORKSPACE}/_build_internal_deps" && cd $_ -cmake -DUSE_THIRDPARTY_LIBRARIES=ON -DENABLE_WARNINGS_AS_ERRORS=ON -DENABLE_COMPRESSION=OFF -DENABLE_PUSH=OFF "${WORKSPACE}" -make -j$(getconf _NPROCESSORS_ONLN) -ctest -V -mkdir -p deploy -make DESTDIR="${PWD}/deploy" install - -mkdir "${WORKSPACE}/_import_internal_deps" && cd $_ -cmake "-Dprometheus-cpp_DIR=${WORKSPACE}/_build_internal_deps/deploy/usr/local/lib/cmake/prometheus-cpp" "${WORKSPACE}/cmake/project-import" -make -j$(getconf _NPROCESSORS_ONLN) - -# Build with external dependencies - -mkdir "${WORKSPACE}/_build" && cd $_ -cmake -DUSE_THIRDPARTY_LIBRARIES=OFF "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" "${WORKSPACE}" -make -j$(getconf _NPROCESSORS_ONLN) -ctest -V -LE Benchmark -mkdir -p deploy -make DESTDIR="${PWD}/deploy" install - -mkdir "${WORKSPACE}/_import" && cd $_ -cmake "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" "-Dprometheus-cpp_DIR=${WORKSPACE}/_build/deploy/usr/local/lib/cmake/prometheus-cpp" "${WORKSPACE}/cmake/project-import" -make -j$(getconf _NPROCESSORS_ONLN) diff --git a/.github/scripts/run-cmake-test.cmd b/.github/scripts/run-cmake-test.cmd deleted file mode 100644 index 86b8a67f..00000000 --- a/.github/scripts/run-cmake-test.cmd +++ /dev/null @@ -1,17 +0,0 @@ -mkdir "_build_internal_deps" || EXIT /B 1 -cd "_build_internal_deps" || EXIT /B 1 -cmake .. -DUSE_THIRDPARTY_LIBRARIES=ON -DENABLE_WARNINGS_AS_ERRORS=ON -DENABLE_COMPRESSION=OFF -DENABLE_PUSH=OFF || EXIT /B 1 -cmake --build . --config Debug || EXIT /B 1 -cmake --build . --config Release || EXIT /B 1 -ctest -C Debug -V -LE Benchmark || EXIT /B 1 -ctest -C Release -V || EXIT /B 1 -cd .. || EXIT /B 1 - -mkdir "_build" || EXIT /B 1 -cd "_build" || EXIT /B 1 -cmake .. -DUSE_THIRDPARTY_LIBRARIES=OFF -DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALLATION_ROOT%\scripts\buildsystems\vcpkg.cmake || EXIT /B 1 -cmake --build . --config Debug || EXIT /B 1 -cmake --build . --config Release || EXIT /B 1 -ctest -C Debug -V -LE Benchmark || EXIT /B 1 -ctest -C Release -V || EXIT /B 1 -cd .. || EXIT /B 1 diff --git a/.github/scripts/run-prepare.cmd b/.github/scripts/run-prepare.cmd deleted file mode 100644 index ec14d92f..00000000 --- a/.github/scripts/run-prepare.cmd +++ /dev/null @@ -1,4 +0,0 @@ -if [%1] == [cmake] ( - %VCPKG_INSTALLATION_ROOT%/vcpkg install benchmark civetweb curl gtest zlib || EXIT /B 1 -) - diff --git a/.github/workflows/cmake-ci.yml b/.github/workflows/cmake-ci.yml new file mode 100644 index 00000000..4e5fca9c --- /dev/null +++ b/.github/workflows/cmake-ci.yml @@ -0,0 +1,109 @@ +name: CMake CI +on: [push, pull_request] + +jobs: + build: + name: CMake on ${{ matrix.os }} with ${{ matrix.dependencies }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macOS-latest, ubuntu-18.04, windows-2016] + dependencies: [submodule, vcpkg] + steps: + - name: Checkout source + uses: actions/checkout@v2 + + - name: Checkout submodules + if: matrix.dependencies == 'submodule' + shell: bash + run: | + auth_header="$(git config --local --get http.https://github.com/.extraheader)" + git submodule sync --recursive + git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 + + - name: Mount vcpkg cache + if: matrix.dependencies == 'vcpkg' + uses: actions/cache@v2 + with: + path: "~/.cache/vcpkg/archives" + key: vcpkg-${{ runner.os }} + + - name: install vcpkg dependencies + if: matrix.dependencies == 'vcpkg' + run: vcpkg install benchmark civetweb curl[core] gtest zlib + + - name: Generate German locale on Ubuntu + if: runner.os == 'Linux' + run: | + sudo apt-get remove -y --purge man-db # avoid time-consuming trigger + sudo apt-get update + sudo apt-get install -y locales + sudo locale-gen de_DE.UTF-8 # used by SerializerTest + + - name: install ninja on Ubuntu + if: runner.os == 'Linux' + run: | + sudo apt-get install -y ninja-build + + - name: install ninja on macOS + if: runner.os == 'macOS' + run: brew install ninja + + - name: "Configure for Unix with internal dependencies" + if: matrix.dependencies == 'submodule' && runner.os != 'Windows' + run: cmake -DUSE_THIRDPARTY_LIBRARIES=ON -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install -DENABLE_WARNINGS_AS_ERRORS=ON -DENABLE_COMPRESSION=OFF -DENABLE_PUSH=OFF -DCMAKE_DEBUG_POSTFIX=_d -DCMAKE_CONFIGURATION_TYPES='Release;Debug' -G"Ninja Multi-Config" -S ${{ github.workspace }} -B ${{ github.workspace }}/_build + + - name: "Configure for Windows with internal dependencies" + if: matrix.dependencies == 'submodule' && runner.os == 'Windows' + run: cmake -DUSE_THIRDPARTY_LIBRARIES=ON -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install -DENABLE_WARNINGS_AS_ERRORS=ON -DENABLE_COMPRESSION=OFF -DENABLE_PUSH=OFF -DCMAKE_DEBUG_POSTFIX=_d -S ${{ github.workspace }} -B ${{ github.workspace }}/_build + + - name: "Configure for Unix with vcpkg dependencies" + if: matrix.dependencies == 'vcpkg' && runner.os != 'Windows' + run: cmake -DUSE_THIRDPARTY_LIBRARIES=OFF -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" -DCMAKE_DEBUG_POSTFIX=_d -DCMAKE_CONFIGURATION_TYPES='Release;Debug' -G"Ninja Multi-Config" -S ${{ github.workspace }} -B ${{ github.workspace }}/_build + + - name: "Configure for Windows with vcpkg dependencies" + if: matrix.dependencies == 'vcpkg' && runner.os == 'Windows' + run: cmake -DUSE_THIRDPARTY_LIBRARIES=OFF -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install "-DCMAKE_TOOLCHAIN_FILE=${Env:VCPKG_INSTALLATION_ROOT}\scripts\buildsystems\vcpkg.cmake" -DCMAKE_DEBUG_POSTFIX=_d -S ${{ github.workspace }} -B ${{ github.workspace }}/_build + + - name: "Build Debug" + run: cmake --build ${{ github.workspace }}/_build --config Debug + + - name: "Build Release" + run: cmake --build ${{ github.workspace }}/_build --config Release + + - name: "Test Debug" + run: ctest -C Debug -V -LE Benchmark + working-directory: "${{ github.workspace }}/_build" + + - name: "Test Release" + run: ctest -C Debug -V -LE Benchmark + working-directory: "${{ github.workspace }}/_build" + + - name: "Install Debug" + run: cmake --install ${{ github.workspace }}/_build --config Debug + + - name: "Install Release" + run: cmake --install ${{ github.workspace }}/_build --config Release + + - name: "Configure import for Unix with internal dependencies" + if: matrix.dependencies == 'submodule' && runner.os != 'Windows' + run: cmake -Dprometheus-cpp_DIR=${{ github.workspace }}/_install/lib/cmake/prometheus-cpp -DCMAKE_CONFIGURATION_TYPES='Release;Debug' -G"Ninja Multi-Config" -S ${{ github.workspace }}/cmake/project-import -B ${{ github.workspace }}/_import + + - name: "Configure import for Windows with internal dependencies" + if: matrix.dependencies == 'submodule' && runner.os == 'Windows' + run: cmake -Dprometheus-cpp_DIR=${{ github.workspace }}/_install/lib/cmake/prometheus-cpp -S ${{ github.workspace }}/cmake/project-import -B ${{ github.workspace }}/_import + + - name: "Configure import for Unix with vcpkg dependencies" + if: matrix.dependencies == 'vcpkg' && runner.os != 'Windows' + run: cmake -Dprometheus-cpp_DIR=${{ github.workspace }}/_install/lib/cmake/prometheus-cpp "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" -DCMAKE_CONFIGURATION_TYPES='Release;Debug' -G"Ninja Multi-Config" -S ${{ github.workspace }}/cmake/project-import -B ${{ github.workspace }}/_import + + - name: "Configure import for Windows with vcpkg dependencies" + if: matrix.dependencies == 'vcpkg' && runner.os == 'Windows' + run: cmake -Dprometheus-cpp_DIR=${{ github.workspace }}/_install/lib/cmake/prometheus-cpp "-DCMAKE_TOOLCHAIN_FILE=${Env:VCPKG_INSTALLATION_ROOT}\scripts\buildsystems\vcpkg.cmake" -S ${{ github.workspace }}/cmake/project-import -B ${{ github.workspace }}/_import + + - name: "Build import Debug" + run: cmake --build ${{ github.workspace }}/_import --config Debug + + - name: "Build import Release" + run: cmake --build ${{ github.workspace }}/_import --config Release diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml deleted file mode 100644 index 76a4a202..00000000 --- a/.github/workflows/continuous-integration-workflow.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Continuous Integration -on: [push, pull_request] - -jobs: - build: - name: ${{ matrix.buildsystem }} on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - buildsystem: [cmake] - os: [macOS-latest, ubuntu-16.04, windows-2016] - steps: - - uses: actions/checkout@v2 - - name: Checkout submodules - shell: bash - run: | - auth_header="$(git config --local --get http.https://github.com/.extraheader)" - git submodule sync --recursive - git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 - - name: Prepare - run: .github/scripts/run-prepare ${{ matrix.buildsystem }} ${{ matrix.os }} - - name: Test - run: .github/scripts/run-${{ matrix.buildsystem }}-test ${{ matrix.os }}