From 9abbd8ab9e00783ca69d01b7af5d38d6cbc475f4 Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Fri, 21 Mar 2025 22:19:54 +0100 Subject: [PATCH 1/2] add debug and remove other actions --- .github/workflows/bazel-ci.yml | 54 ------------- .github/workflows/cmake-ci.yml | 135 --------------------------------- .github/workflows/coverage.yml | 4 + .github/workflows/doxygen.yml | 30 -------- .github/workflows/linting.yml | 54 ------------- .github/workflows/release.yml | 34 --------- 6 files changed, 4 insertions(+), 307 deletions(-) delete mode 100644 .github/workflows/bazel-ci.yml delete mode 100644 .github/workflows/cmake-ci.yml delete mode 100644 .github/workflows/doxygen.yml delete mode 100644 .github/workflows/linting.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/bazel-ci.yml b/.github/workflows/bazel-ci.yml deleted file mode 100644 index afbc158f..00000000 --- a/.github/workflows/bazel-ci.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Bazel CI -on: - pull_request: - push: - branches: - - master - -jobs: - build: - name: Bazel on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-latest, ubuntu-latest, windows-latest] - include: - - os: macOS-latest - bazel_args: "--cxxopt=-std=c++17" - - os: ubuntu-latest - bazel_args: "--cxxopt=-std=c++17" - - os: windows-latest - bazel_args: "--cxxopt=/std:c++17" - steps: - - name: Checkout source - uses: actions/checkout@v4 - - - 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 telegraf on macOS - if: runner.os == 'macOS' - run: brew install telegraf - - - name: Build with SSL - if: runner.os != 'macOS' - run: bazel build ${{ matrix.bazel_args }} --config=ssl //... - - - name: Test with SSL - if: runner.os != 'macOS' - run: bazel test ${{ matrix.bazel_args }} --config=ssl --test_output=all //... - - - name: Build - run: bazel build ${{ matrix.bazel_args }} //... - - - name: Test - run: bazel test ${{ matrix.bazel_args }} --test_output=all //... - - - name: Scraping Test - if: runner.os == 'macOS' - run: bazel test ${{ matrix.bazel_args }} --test_output=all //pull/tests/integration:scrape-test diff --git a/.github/workflows/cmake-ci.yml b/.github/workflows/cmake-ci.yml deleted file mode 100644 index 91f74778..00000000 --- a/.github/workflows/cmake-ci.yml +++ /dev/null @@ -1,135 +0,0 @@ -name: CMake CI -on: - pull_request: - push: - branches: - - master - -jobs: - build: - name: CMake on ${{ matrix.os }} with ${{ matrix.dependencies }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macos-13, ubuntu-22.04, windows-2019] - dependencies: [submodule, vcpkg] - steps: - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: ${{ matrix.dependencies == 'submodule' }} - - - name: Mount vcpkg cache - if: matrix.dependencies == 'vcpkg' - uses: actions/cache@v4 - with: - path: "~/.cache/vcpkg/archives" - key: vcpkg-${{ matrix.os }} - - - name: Default to x64-windows vcpkg triplet - if: matrix.dependencies == 'vcpkg' && runner.os == 'Windows' - run: echo "VCPKG_DEFAULT_TRIPLET=x64-windows" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append - - - 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 -DBUILD_SHARED_LIBS=ON - - - 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 -DBUILD_SHARED_LIBS=ON - - - 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 Release -V -LE Benchmark - working-directory: "${{ github.workspace }}/_build" - - - name: "Run Benchmark" - run: ctest -C Release -V -L 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 CMake 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-cmake -B ${{ github.workspace }}/_import_cmake - - - name: "Configure CMake 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-cmake -B ${{ github.workspace }}/_import_cmake - - - name: "Configure CMake 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-cmake -B ${{ github.workspace }}/_import_cmake - - - name: "Configure CMake 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-cmake -B ${{ github.workspace }}/_import_cmake - - - name: "Build CMake import Debug" - run: cmake --build ${{ github.workspace }}/_import_cmake --config Debug - - - name: "Build CMake import Release" - run: cmake --build ${{ github.workspace }}/_import_cmake --config Release - - - name: "Configure for Unix Shared Libs with internal dependencies" - if: matrix.dependencies == 'submodule' && runner.os != 'Windows' - run: cmake -DUSE_THIRDPARTY_LIBRARIES=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install_shared -DENABLE_WARNINGS_AS_ERRORS=ON -DENABLE_COMPRESSION=OFF -DENABLE_PUSH=OFF -DCMAKE_DEBUG_POSTFIX=_d -GNinja -S ${{ github.workspace }} -B ${{ github.workspace }}/_build_shared - - - name: "Build for Unix Shared Libs" - if: matrix.dependencies == 'submodule' && runner.os != 'Windows' - run: cmake --build ${{ github.workspace }}/_build_shared - - - name: "Install for Unix Shared Libs" - if: matrix.dependencies == 'submodule' && runner.os != 'Windows' - run: cmake --install ${{ github.workspace }}/_build_shared - - - name: "Configure pkg-config import for Unix" - if: matrix.dependencies == 'submodule' && runner.os != 'Windows' - run: cmake -DCMAKE_PREFIX_PATH=${{ github.workspace }}/_install_shared -GNinja -S ${{ github.workspace }}/cmake/project-import-pkgconfig -B ${{ github.workspace }}/_import_pkgconfig - - - name: "Build pkg-config import for Unix" - if: matrix.dependencies == 'submodule' && runner.os != 'Windows' - run: cmake --build ${{ github.workspace }}/_import_pkgconfig diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 9da81714..863534b5 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -57,8 +57,12 @@ jobs: - name: Run lcov run: lcov --capture --directory "${{ github.workspace }}/_build" --output-file coverage.info --no-external --directory "${{ github.workspace }}" --exclude '*/tests/*' + - name: dump lcov + run: lcov --list coverage.info + - name: Coveralls uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} files: coverage.info + debug: true diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml deleted file mode 100644 index 95c78715..00000000 --- a/.github/workflows/doxygen.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Doxygen -on: - push: - branches: - - master - -jobs: - build: - name: Documentation - runs-on: ubuntu-24.04 - steps: - - name: Checkout source - uses: actions/checkout@v4 - - - name: Install doxygen - run: | - sudo apt-get remove -y --purge man-db # avoid time-consuming trigger - sudo apt-get update - sudo apt-get install -y doxygen graphviz - - - name: Generate doxygen - run: doxygen - working-directory: "${{ github.workspace }}/doc" - - - name: Deploy documentation - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - force_orphan: true - publish_dir: ./doc/html diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml deleted file mode 100644 index eb6e5f33..00000000 --- a/.github/workflows/linting.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Linting -on: - pull_request: - push: - branches: - - master - -jobs: - iwyu: - name: Include What You Use - runs-on: ubuntu-latest - container: - image: debian:sid-slim - steps: - - name: Install dependencies - run: | - apt-get update - apt-get install -y --no-install-recommends ca-certificates clang-19 cmake git iwyu libbenchmark-dev libcurl4-openssl-dev ninja-build zlib1g-dev - - - name: Checkout source - uses: actions/checkout@v4 - with: - submodules: true - - - name: "CMake Configure" - run: cmake -GNinja -DRUN_IWYU=ON -DCMAKE_C_COMPILER=clang-19 -DCMAKE_CXX_COMPILER=clang++-19 -S ${GITHUB_WORKSPACE} -B ${GITHUB_WORKSPACE}/_build - - - name: Build - run: cmake --build ${GITHUB_WORKSPACE}/_build 2>&1 | tee ${GITHUB_WORKSPACE}/output.txt - - - name: Check build output - run: if egrep -q 'should (add|remove) these lines' ${GITHUB_WORKSPACE}/output.txt; then exit 1; fi - - #- name: "CMake Configure" - # run: cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -S ${GITHUB_WORKSPACE} -B ${GITHUB_WORKSPACE}/_build - - #- name: "Run IWYU" - # run: iwyu_tool -p ${GITHUB_WORKSPACE}/_build core push pull -- -Xiwyu --mapping_file=${GITHUB_WORKSPACE}/cmake/googletest.imp -Xiwyu --no_fwd_decls 2>&1 | tee ${{ github.workspace }}/output.txt - - format: - name: Clang Format - runs-on: ubuntu-24.04 - steps: - - name: Checkout source - uses: actions/checkout@v4 - - # clang-format comes pre-installed - # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md - - - name: Run clang-format - run: find . -type f \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.cxx' -o -name '*.o' -o -name '*.h' -o -name '*.hpp' -o -name '*.hxx' \) -exec clang-format-15 -style=file -i {} \; - - - name: Check for changes - run: git diff --exit-code diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 01ad2132..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,34 +0,0 @@ -on: - release: - types: [created] - -name: Handle Release - -jobs: - build: - name: Upload Release Asset - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - persist-credentials: false - submodules: true - - - name: Create tarball including submodules - shell: bash - env: - PREFIX: prometheus-cpp-with-submodules - run: | - git archive --prefix "${PREFIX}/" -o "${PREFIX}.tar" HEAD - git submodule foreach --recursive "git archive --prefix=${PREFIX}/\$path/ --output=\$sha1.tar HEAD && tar --concatenate --file=$(pwd)/${PREFIX}.tar \$sha1.tar && rm \$sha1.tar" - gzip "${PREFIX}.tar" - - # using the official actions/upload-release-asset action would be preferred but is blocked by - # https://github.com/actions/upload-release-asset/pull/41 - - name: Upload the artifacts - uses: skx/github-action-publish-binaries@75ce5546020fc1848da842f40240f9fa03e7a3a8 # release-0.14 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - args: prometheus-cpp-with-submodules.tar.gz From d12a00377a0ce3757f8b0778ab8c645664152eae Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Sat, 22 Mar 2025 15:50:39 +0100 Subject: [PATCH 2/2] compare with Ubuntu 20.04 --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 863534b5..a1376d4e 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -8,7 +8,7 @@ on: jobs: build: name: Code Coverage - runs-on: ubuntu-24.04 + runs-on: ubuntu-20.04 steps: - name: Checkout source uses: actions/checkout@v4