diff --git a/.github/scripts/run-cmake-coverage b/.github/scripts/run-cmake-coverage deleted file mode 100755 index 1dc61ef4..00000000 --- a/.github/scripts/run-cmake-coverage +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -WORKSPACE=$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. && /bin/pwd -P) -PATH=$HOME/.local/bin:$PATH - -pip install --user cpp-coveralls - -# Build with coverage - -mkdir "${WORKSPACE}/_build_coverage" && cd $_ -CFLAGS="--coverage" CXXFLAGS="--coverage" LDFLAGS="--coverage" cmake .. -DUSE_THIRDPARTY_LIBRARIES=OFF "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" -make -j$(nproc) -ctest -V -LE Benchmark - -# Collect coverage data - -export TRAVIS_BRANCH=${GITHUB_REF} -coveralls --root .. --build-root . --gcov-options '\-lp' -E ".*/3rdparty/.*" -E ".*/_.*" -E ".*/tests/.*" -E ".*/benchmarks/.*" -E "./CMake.*CompilerId.c" diff --git a/.github/scripts/run-prepare b/.github/scripts/run-prepare deleted file mode 100755 index e80d1276..00000000 --- a/.github/scripts/run-prepare +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -BUILDSYSTEM_ARG=${1:?} -OS_ARG=${2:?} - -case "${OS_ARG}" in - ubuntu*) - packages=(locales) - - case "${BUILDSYSTEM_ARG}" in - cmake) - packages+=(python-pip python-wheel) - ;; - esac - - sudo apt-get remove -y --purge man-db # avoid time-consuming trigger - sudo apt-get update - sudo apt-get install -y "${packages[@]}" - sudo locale-gen de_DE.UTF-8 # used by SerializerTest - ;; -esac - -case "${BUILDSYSTEM_ARG}" in - cmake) - "${VCPKG_INSTALLATION_ROOT}/vcpkg" install benchmark civetweb curl gtest zlib - ;; -esac diff --git a/.github/workflows/bazel-ci.yml b/.github/workflows/bazel-ci.yml index 841d9b3a..bf8b3d10 100644 --- a/.github/workflows/bazel-ci.yml +++ b/.github/workflows/bazel-ci.yml @@ -1,5 +1,5 @@ name: Bazel CI -on: [push, pull_request] +on: [] #[push, pull_request] jobs: build: diff --git a/.github/workflows/cmake-ci.yml b/.github/workflows/cmake-ci.yml index 4e5fca9c..f09a162f 100644 --- a/.github/workflows/cmake-ci.yml +++ b/.github/workflows/cmake-ci.yml @@ -1,5 +1,5 @@ name: CMake CI -on: [push, pull_request] +on: [] #[push, pull_request] jobs: build: @@ -27,7 +27,7 @@ jobs: uses: actions/cache@v2 with: path: "~/.cache/vcpkg/archives" - key: vcpkg-${{ runner.os }} + key: vcpkg-${{ matrix.os }} - name: install vcpkg dependencies if: matrix.dependencies == 'vcpkg' diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 53c8f88b..79d8d869 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -3,25 +3,59 @@ on: [push, pull_request] jobs: build: - name: Coverage ${{ matrix.buildsystem }} on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - buildsystem: [cmake] - os: [ubuntu-16.04] + name: Code Coverage + runs-on: ubuntu-16.04 steps: - - uses: actions/checkout@master - - name: Checkout submodules - shell: bash + - name: Checkout source + uses: actions/checkout@v2 + + - name: Mount vcpkg cache + uses: actions/cache@v2 + with: + path: "~/.cache/vcpkg/archives" + key: vcpkg-${{ matrix.os }} + + - name: install vcpkg dependencies + 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 coveralls + if: runner.os == 'Linux' 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 }} + sudo apt-get install -y python-pip python-wheel + pip install --user cpp-coveralls + + - name: "CMake Configure for Unix with vcpkg dependencies" + env: + CFLAGS: "--coverage" + CXXFLAGS: "--coverage" + LDFLAGS: "--coverage" + run: cmake -DUSE_THIRDPARTY_LIBRARIES=OFF "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" -GNinja -S ${{ github.workspace }} -B ${{ github.workspace }}/_build + + - name: Build + run: cmake --build ${{ github.workspace }}/_build + - name: Test + run: ctest -V -LE Benchmark + working-directory: "${{ github.workspace }}/_build" + + - name: Upload Coverage if: github.repository == 'jupp0r/prometheus-cpp' env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} COVERALLS_GIT_BRANCH: "${{ github.ref }}" - run: .github/scripts/run-cmake-coverage + TRAVIS_BRANCH: "${{ github.ref }}" + working-directory: "${{ github.workspace }}/_build" + run: ~/.local/bin/coveralls --root .. --build-root . --gcov-options '\-lp' -E ".*/3rdparty/.*" -E ".*/_.*" -E ".*/tests/.*" -E ".*/benchmarks/.*" -E "./CMake.*CompilerId.c"