From 4880c649e1c7ed1f8cab6140e466762c924236f2 Mon Sep 17 00:00:00 2001 From: Sergiu Deitsch Date: Wed, 10 Nov 2021 22:48:27 +0100 Subject: [PATCH] added coveralls parallel workflow --- .github/workflows/android-builds.yml | 40 --- .github/workflows/builds.yml | 375 +++++++++++++++++++++++++++ .github/workflows/coveralls.yml | 84 ------ .github/workflows/linux-builds.yml | 139 ---------- .github/workflows/macos-builds.yml | 47 ---- .github/workflows/windows-builds.yml | 171 ------------ README.rst | 8 +- 7 files changed, 377 insertions(+), 487 deletions(-) delete mode 100644 .github/workflows/android-builds.yml create mode 100644 .github/workflows/builds.yml delete mode 100644 .github/workflows/coveralls.yml delete mode 100644 .github/workflows/linux-builds.yml delete mode 100644 .github/workflows/macos-builds.yml delete mode 100644 .github/workflows/windows-builds.yml diff --git a/.github/workflows/android-builds.yml b/.github/workflows/android-builds.yml deleted file mode 100644 index 0e0571ea9..000000000 --- a/.github/workflows/android-builds.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Android - -on: [push, pull_request] - -jobs: - build: - name: NDK-C++${{matrix.std}}-${{matrix.abi}}-${{matrix.build_type}} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - std: [98, 11, 14, 17, 20] - abi: [arm64-v8a, armeabi-v7a, x86_64, x86] - build_type: [Debug] - - steps: - - uses: actions/checkout@v2 - - - name: Setup Ninja - uses: ashutoshvarma/setup-ninja@master - with: - version: 1.10.0 - - - name: Configure - shell: bash - run: | - cmake -S . -B ${{runner.workspace}}/build_CXX${{matrix.std}}-${{matrix.abi}} \ - -G "Ninja Multi-Config" \ - -DCMAKE_CXX_EXTENSIONS=OFF \ - -DCMAKE_CXX_STANDARD=${{matrix.std}} \ - -DCMAKE_CXX_STANDARD_REQUIRED=ON \ - -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \ - -DANDROID_STL=c++_shared \ - -DANDROID_NATIVE_API_LEVEL=28 \ - -DANDROID_ABI=${{matrix.abi}} \ - - name: Build - run: | - cmake --build ${{runner.workspace}}/build_CXX${{matrix.std}}-${{matrix.abi}} \ - --config ${{matrix.build_type}} - diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml new file mode 100644 index 000000000..9e93b68ce --- /dev/null +++ b/.github/workflows/builds.yml @@ -0,0 +1,375 @@ +name: Linux + +on: [push, pull_request] + +jobs: + build-linux: + defaults: + run: + shell: bash + name: GCC-C++${{matrix.std}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.extra}} + runs-on: ubuntu-latest + env: + BUILDDIR: 'build_GCC-C++${{matrix.std}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.extra}}' + strategy: + fail-fast: true + matrix: + build_type: [Release, Debug] + extra: [no-custom-prefix, custom-prefix] + lib: [shared, static] + std: [98, 11, 14, 17, 20] + + steps: + - uses: actions/checkout@v2 + + - name: Setup Dependencies + run: | + sudo apt-get update + DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \ + build-essential \ + cmake \ + lcov \ + libgflags-dev \ + libunwind-dev \ + ninja-build + + - name: Build GTest + run: | + wget https://github.com/google/googletest/archive/refs/tags/release-1.11.0.tar.gz + tar xvf release-1.11.0.tar.gz + cmake -S googletest-release-1.11.0 -B build-googletest \ + -DBUILD_SHARED_LIBS=${{matrix.shared}} \ + -DCMAKE_INSTALL_PREFIX=./install \ + -G Ninja + cmake --build build-googletest --target install + + - name: Setup Environment + if: ${{matrix.build_type == 'Debug'}} + run: | + echo 'CXXFLAGS=--coverage' >> $GITHUB_ENV + + - name: Configure + run: | + cmake -S . -B "${{env.BUILDDIR}}" -G Ninja \ + -DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} \ + -DCMAKE_CXX_STANDARD=${{matrix.std}} \ + -DCMAKE_CXX_STANDARD_REQUIRED=ON \ + -DCMAKE_INSTALL_PREFIX:PATH=./install \ + -DWITH_CUSTOM_PREFIX=${{matrix.extra == 'custom-prefix'}} + + - name: Build + run: | + cmake --build "${{env.BUILDDIR}}" \ + --config ${{matrix.build_type}} + + - name: Install + run: | + cmake --build "${{env.BUILDDIR}}" \ + --config ${{matrix.build_type}} \ + --target install + + cmake "${{env.BUILDDIR}}" -G Ninja \ + -DCMAKE_INSTALL_INCLUDEDIR=${{runner.workspace}}/foo/include \ + -DCMAKE_INSTALL_LIBDIR=${{runner.workspace}}/foo/lib \ + -DCMAKE_INSTALL_DATAROOTDIR=${{runner.workspace}}/foo/share + cmake --build "${{env.BUILDDIR}}" \ + --config ${{matrix.build_type}} \ + --target install + + - name: Test CMake Package (relative GNUInstallDirs) + run: | + cmake -S src/package_config_unittest/working_config \ + -B "${{env.BUILDDIR}}_package" \ + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ + -DCMAKE_PREFIX_PATH="./${BUILDDIR}/install" \ + -G Ninja + cmake --build "${{env.BUILDDIR}}_package" \ + --config ${{matrix.build_type}} + + - name: Test CMake Package (absolute GNUInstallDirs) + run: | + cmake -S src/package_config_unittest/working_config \ + -B "${{env.BUILDDIR}}_package_foo" \ + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ + -DCMAKE_PREFIX_PATH=${{runner.workspace}}/foo \ + -G Ninja + cmake --build "${{env.BUILDDIR}}_package_foo" \ + --config ${{matrix.build_type}} + + - name: Test + run: | + ctest --test-dir "${{env.BUILDDIR}}" -j$(nproc) --output-on-failure + + - name: Generate Coverage + if: ${{ startswith(matrix.build_type, 'Debug') }} + run: | + lcov --directory . --capture --output-file coverage.info + lcov --remove coverage.info \ + '*/install/include/*' \ + '*/src/*_unittest.cc' \ + '*/src/googletest.h' \ + '*/src/mock-log.h' \ + '/usr/*' \ + --output-file coverage.info + + for file in src/glog/*.h.in; do + name=$(basename ${file}) + name_we=${name%.h.in} + sed -i "s|${{env.BUILDDIR}}/glog/${name_we}.h\$|${file}|g" coverage.info + done + + lcov --list coverage.info + + - name: Upload Coverage to Coveralls + if: ${{ startswith(matrix.build_type, 'Debug') }} + uses: coverallsapp/github-action@master + with: + flag-name: GCC-C++${{matrix.std}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.extra}} + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel: true + path-to-lcov: ./coverage.info + + build-msvc: + if: ${{false}} + name: ${{matrix.msvc}}-${{matrix.arch}}-C++${{matrix.std}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.extra}} + runs-on: ${{matrix.os}} + defaults: + run: + shell: powershell + strategy: + fail-fast: false + matrix: + arch: [Win32, x64] + build_type: [Debug, Release] + extra: [no-custom-prefix, custom-prefix] + lib: [shared, static] + msvc: [VS-15-2017, VS-16-2019, VS-17-2022] + std: [98, 11, 14, 17, 20] + include: + - msvc: VS-15-2017 + os: windows-2016 + generator: 'Visual Studio 15 2017' + - msvc: VS-16-2019 + os: windows-2019 + generator: 'Visual Studio 16 2019' + - msvc: VS-17-2022 + os: windows-2022 + generator: 'Visual Studio 17 2022' + + steps: + - uses: actions/checkout@v2 + + - name: Configure + run: | + cmake -S . -B build_${{matrix.build_type}} ` + -A ${{matrix.arch}} ` + -DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} ` + -DCMAKE_CXX_EXTENSIONS=OFF ` + -DCMAKE_CXX_STANDARD=${{matrix.std}} ` + -DCMAKE_CXX_STANDARD_REQUIRED=ON ` + -DCMAKE_INSTALL_PREFIX:PATH=./install ` + -DWITH_CUSTOM_PREFIX=${{matrix.extra == 'custom-prefix'}} ` + -G "${{matrix.generator}}" + + - name: Build + run: cmake --build build_${{matrix.build_type}} ` + --config ${{matrix.build_type}} + + - name: Test + env: + CTEST_OUTPUT_ON_FAILURE: 1 + run: | + cmake --build build_${{matrix.build_type}}/ ` + --config ${{matrix.build_type}} ` + --target RUN_TESTS + + - name: Install + run: | + cmake --build build_${{matrix.build_type}}/ ` + --config ${{matrix.build_type}} ` + --target install + + build-mingw: + if: ${{false}} + name: ${{matrix.sys}}-${{matrix.env}}-C++${{matrix.std}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.extra}} + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + strategy: + fail-fast: false + matrix: + build_type: [Debug, Release] + extra: [no-custom-prefix, custom-prefix] + lib: [shared, static] + std: [98, 11, 14, 17, 20] + sys: [mingw32, mingw64] + include: + - sys: mingw32 + env: i686 + - sys: mingw64 + env: x86_64 + + steps: + - uses: actions/checkout@v2 + - uses: msys2/setup-msys2@v2 + with: + msystem: ${{matrix.sys}} + install: >- + lcov + mingw-w64-${{matrix.env}}-cmake + mingw-w64-${{matrix.env}}-gcc + mingw-w64-${{matrix.env}}-gflags + mingw-w64-${{matrix.env}}-ninja + + - name: Configure + env: + CXXFLAGS: -Wall -Wextra -Wpedantic -Wsign-conversion -Wtautological-compare -Werror -Wno-error=variadic-macros -Wno-error=long-long + run: | + if [[ ${{matrix.build_type}} == "Debug" ]]; then + export CXXFLAGS="--coverage ${CXXFLAGS}" + fi + + cmake -S . -B build_${{matrix.build_type}}/ \ + -DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} \ + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ + -DCMAKE_CXX_EXTENSIONS=OFF \ + -DCMAKE_CXX_STANDARD=${{matrix.std}} \ + -DCMAKE_CXX_STANDARD_REQUIRED=ON \ + -DCMAKE_INSTALL_PREFIX:PATH=./install \ + -DWITH_CUSTOM_PREFIX=${{matrix.extra == 'custom-prefix'}} \ + -G Ninja + + - name: Build + run: | + cmake --build build_${{matrix.build_type}}/ --config ${{matrix.build_type}} + + - name: Test + env: + CTEST_OUTPUT_ON_FAILURE: 1 + run: | + cmake --build build_${{matrix.build_type}}/ --config ${{matrix.build_type}} \ + --target test + + - name: Install + run: | + cmake --build build_${{matrix.build_type}}/ \ + --config ${{matrix.build_type}} \ + --target install + + - name: Generate Coverage + if: ${{ startswith(matrix.build_type, 'Debug') }} + run: | + lcov --directory . --capture --output-file coverage.info + lcov --remove coverage.info \ + '*/install/include/*' \ + '*/msys64/mingw32/*' \ + '*/msys64/mingw64/*' \ + '*/src/*_unittest.cc' \ + '*/src/googletest.h' \ + '*/src/mock-log.h' \ + --output-file coverage.info + + for file in src/glog/*.h.in; do + name=$(basename ${file}) + name_we=${name%.h.in} + sed -i "s|build_${{matrix.build_type}}/glog/${name_we}.h\$|${file}|g" coverage.info + done + + lcov --list coverage.info + + build-macos: + if: ${{false}} + name: AppleClang-C++${{matrix.std}}-${{matrix.build_type}} + runs-on: macos-10.15 + strategy: + fail-fast: false + matrix: + std: [98, 11, 14, 17, 20] + include: + - generator: Ninja + - build_type: Debug + + steps: + - uses: actions/checkout@v2 + + - name: Setup Ninja + uses: ashutoshvarma/setup-ninja@master + with: + version: 1.10.0 + + - name: Configure + shell: bash + env: + CXXFLAGS: -Wall -Wextra -Wsign-conversion -Wtautological-compare -Werror + run: | + if [[ ${{matrix.std}} == 98 ]]; then + export CXXFLAGS="-Werror=c++11-extensions ${CXXFLAGS}" + fi + cmake -S . -B ${{runner.workspace}}/build_${{matrix.name}}_${{matrix.build_type}} \ + -G "${{matrix.generator}}" \ + -DCMAKE_CXX_EXTENSIONS=OFF \ + -DCMAKE_CXX_FLAGS_DEBUG=-pedantic-errors \ + -DCMAKE_CXX_FLAGS_RELEASE=-pedantic-errors \ + -DCMAKE_CXX_STANDARD=${{matrix.std}} \ + -DCMAKE_CXX_STANDARD_REQUIRED=ON + - name: Build + run: | + cmake --build ${{runner.workspace}}/build_${{matrix.name}}_${{matrix.build_type}} \ + --config ${{matrix.build_type}} + - name: Run tests + run: | + ctest --test-dir ${{runner.workspace}}/build_${{matrix.name}}_${{matrix.build_type}} \ + --output-on-failure + + build-android: + if: ${{false}} + name: NDK-C++${{matrix.std}}-${{matrix.abi}}-${{matrix.build_type}} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + std: [98, 11, 14, 17, 20] + abi: [arm64-v8a, armeabi-v7a, x86_64, x86] + build_type: [Debug] + + steps: + - uses: actions/checkout@v2 + + - name: Setup Ninja + uses: ashutoshvarma/setup-ninja@master + with: + version: 1.10.0 + + - name: Configure + shell: bash + run: | + cmake -S . -B ${{runner.workspace}}/build_CXX${{matrix.std}}-${{matrix.abi}} \ + -G "Ninja Multi-Config" \ + -DCMAKE_CXX_EXTENSIONS=OFF \ + -DCMAKE_CXX_STANDARD=${{matrix.std}} \ + -DCMAKE_CXX_STANDARD_REQUIRED=ON \ + -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \ + -DANDROID_STL=c++_shared \ + -DANDROID_NATIVE_API_LEVEL=28 \ + -DANDROID_ABI=${{matrix.abi}} \ + - name: Build + run: | + cmake --build ${{runner.workspace}}/build_CXX${{matrix.std}}-${{matrix.abi}} \ + --config ${{matrix.build_type}} + + merge: + name: Aggregate coverage reports + runs-on: ubuntu-latest + needs: + - build-linux + - build-mingw + + steps: + - uses: actions/checkout@v2 + + - name: Upload Coverage to Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml deleted file mode 100644 index 21b5be350..000000000 --- a/.github/workflows/coveralls.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Coveralls - -on: - workflow_run: - workflows: [Linux] - types: - - completed - -jobs: - merge: - name: Aggregate coverage reports - defaults: - run: - shell: bash - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Setup Dependencies - env: - DEBIAN_FRONTEND: noninteractive - run: | - sudo apt-get update - sudo apt-get install -y lcov - - - name: Download Artifacts - uses: actions/github-script@v3.1.0 - with: - script: | - var artifacts = await github.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id}}, - }); - var matchArtifacts = artifacts.data.artifacts; - for (artifact of matchArtifacts) { - var download = await github.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: artifact.id, - archive_format: 'zip', - }); - var fs = require('fs'); - fs.writeFileSync('${{github.workspace}}/' + artifact.name + '.zip', Buffer.from(download.data)); - } - - - name: Unpack Artifacts - run: | - for file in *.zip; do - unzip "$file" -d "build_${file%.zip}" - done - - - name: Generate Coverage - run: | - lcov --directory . --capture --output-file coverage.info - lcov --remove coverage.info \ - '*/install/include/*' \ - '*/msys64/mingw32/*' \ - '*/msys64/mingw64/*' \ - '*/src/*_unittest.cc' \ - '*/src/googletest.h' \ - '*/src/mock-log.h' \ - '/usr/*' \ - --output-file coverage.info - - readarray -t build_dirs < <(ls -d build_*/) - - for file in src/glog/*.h.in; do - name=$(basename ${file}) - name_we=${name%.h.in} - - for build_dir in ${build_dirs[@]}; do - sed -i "s|${build_dir%/}/glog/${name_we}.h\$|${file}|g" coverage.info - done - done - - lcov --list coverage.info - - - name: Upload Coverage to Coveralls - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: ./coverage.info diff --git a/.github/workflows/linux-builds.yml b/.github/workflows/linux-builds.yml deleted file mode 100644 index 4563b61b3..000000000 --- a/.github/workflows/linux-builds.yml +++ /dev/null @@ -1,139 +0,0 @@ -name: Linux - -on: [push, pull_request] - -jobs: - build: - defaults: - run: - shell: bash - name: GCC-C++${{matrix.std}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.extra}} - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - build_type: [Release, Debug] - extra: [no-custom-prefix, custom-prefix] - lib: [shared, static] - std: [98, 11, 14, 17, 20] - - steps: - - uses: actions/checkout@v2 - - - name: Setup Dependencies - run: | - sudo apt-get update - DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \ - build-essential \ - cmake \ - lcov \ - libgflags-dev \ - libunwind-dev \ - ninja-build - - - name: Build GTest - run: | - wget https://github.com/google/googletest/archive/refs/tags/release-1.11.0.tar.gz - tar xvf release-1.11.0.tar.gz - cmake -S googletest-release-1.11.0 -B build-googletest \ - -DBUILD_SHARED_LIBS=${{matrix.shared}} \ - -DCMAKE_INSTALL_PREFIX=./install \ - -G Ninja - cmake --build build-googletest --target install - - - name: Setup Environment - if: ${{matrix.build_type == 'Debug'}} - run: | - echo 'CXXFLAGS=--coverage' >> $GITHUB_ENV - - - name: Configure - run: | - cmake -S . -B build_${{matrix.build_type}} -G Ninja \ - -DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} \ - -DCMAKE_CXX_STANDARD=${{matrix.std}} \ - -DCMAKE_CXX_STANDARD_REQUIRED=ON \ - -DCMAKE_INSTALL_PREFIX:PATH=./install \ - -DWITH_CUSTOM_PREFIX=${{matrix.extra == 'custom-prefix'}} - - - name: Build - run: | - cmake --build build_${{matrix.build_type}} \ - --config ${{matrix.build_type}} - - - name: Install - run: | - cmake --build build_${{matrix.build_type}} \ - --config ${{matrix.build_type}} \ - --target install - - cmake build_${{matrix.build_type}} -G Ninja \ - -DCMAKE_INSTALL_INCLUDEDIR=${{runner.workspace}}/foo/include \ - -DCMAKE_INSTALL_LIBDIR=${{runner.workspace}}/foo/lib \ - -DCMAKE_INSTALL_DATAROOTDIR=${{runner.workspace}}/foo/share - cmake --build build_${{matrix.build_type}} \ - --config ${{matrix.build_type}} \ - --target install - - - name: Test CMake Package (relative GNUInstallDirs) - run: | - cmake -S src/package_config_unittest/working_config \ - -B build_${{matrix.build_type}}_package \ - -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ - -DCMAKE_PREFIX_PATH=./build_${{matrix.build_type}}/install \ - -G Ninja - cmake --build build_${{matrix.build_type}}_package \ - --config ${{matrix.build_type}} - - - name: Test CMake Package (absolute GNUInstallDirs) - run: | - cmake -S src/package_config_unittest/working_config \ - -B build_${{matrix.build_type}}_package_foo \ - -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ - -DCMAKE_PREFIX_PATH=${{runner.workspace}}/foo \ - -G Ninja - cmake --build build_${{matrix.build_type}}_package_foo \ - --config ${{matrix.build_type}} - - - name: Test - run: | - ctest --test-dir build_${{matrix.build_type}} -j$(nproc) --output-on-failure - - - name: Generate Coverage - if: ${{ startswith(matrix.build_type, 'Debug') }} - run: | - lcov --directory . --capture --output-file coverage.info - lcov --remove coverage.info \ - '*/install/include/*' \ - '*/src/*_unittest.cc' \ - '*/src/googletest.h' \ - '*/src/mock-log.h' \ - '/usr/*' \ - --output-file coverage.info - - for file in src/glog/*.h.in; do - name=$(basename ${file}) - name_we=${name%.h.in} - sed -i "s|build_${{matrix.build_type}}/glog/${name_we}.h\$|${file}|g" coverage.info - done - - lcov --list coverage.info - - - name: Upload Coverage to Coveralls - if: ${{ startswith(matrix.build_type, 'Debug') }} - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: ./coverage.info - flag-name: GCC-C++${{matrix.std}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.extra}} - parallel: true - - finish: - needs: build - runs-on: ubuntu-latest - - steps: - - name: Coveralls Finished - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - parallel-finished: true diff --git a/.github/workflows/macos-builds.yml b/.github/workflows/macos-builds.yml deleted file mode 100644 index 3629d34c0..000000000 --- a/.github/workflows/macos-builds.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: macOS - -on: [push, pull_request] - -jobs: - build: - name: AppleClang-C++${{matrix.std}}-${{matrix.build_type}} - runs-on: macos-10.15 - strategy: - fail-fast: false - matrix: - std: [98, 11, 14, 17, 20] - include: - - generator: Ninja - - build_type: Debug - - steps: - - uses: actions/checkout@v2 - - - name: Setup Ninja - uses: ashutoshvarma/setup-ninja@master - with: - version: 1.10.0 - - - name: Configure - shell: bash - env: - CXXFLAGS: -Wall -Wextra -Wsign-conversion -Wtautological-compare -Werror - run: | - if [[ ${{matrix.std}} == 98 ]]; then - export CXXFLAGS="-Werror=c++11-extensions ${CXXFLAGS}" - fi - cmake -S . -B ${{runner.workspace}}/build_${{matrix.name}}_${{matrix.build_type}} \ - -G "${{matrix.generator}}" \ - -DCMAKE_CXX_EXTENSIONS=OFF \ - -DCMAKE_CXX_FLAGS_DEBUG=-pedantic-errors \ - -DCMAKE_CXX_FLAGS_RELEASE=-pedantic-errors \ - -DCMAKE_CXX_STANDARD=${{matrix.std}} \ - -DCMAKE_CXX_STANDARD_REQUIRED=ON - - name: Build - run: | - cmake --build ${{runner.workspace}}/build_${{matrix.name}}_${{matrix.build_type}} \ - --config ${{matrix.build_type}} - - name: Run tests - run: | - ctest --test-dir ${{runner.workspace}}/build_${{matrix.name}}_${{matrix.build_type}} \ - --output-on-failure diff --git a/.github/workflows/windows-builds.yml b/.github/workflows/windows-builds.yml deleted file mode 100644 index c9159805b..000000000 --- a/.github/workflows/windows-builds.yml +++ /dev/null @@ -1,171 +0,0 @@ -name: Windows - -on: [push, pull_request] - -jobs: - build-msvc: - name: ${{matrix.msvc}}-${{matrix.arch}}-C++${{matrix.std}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.extra}} - runs-on: ${{matrix.os}} - defaults: - run: - shell: powershell - strategy: - fail-fast: false - matrix: - arch: [Win32, x64] - build_type: [Debug, Release] - extra: [no-custom-prefix, custom-prefix] - lib: [shared, static] - msvc: [VS-15-2017, VS-16-2019, VS-17-2022] - std: [98, 11, 14, 17, 20] - include: - - msvc: VS-15-2017 - os: windows-2016 - generator: 'Visual Studio 15 2017' - - msvc: VS-16-2019 - os: windows-2019 - generator: 'Visual Studio 16 2019' - - msvc: VS-17-2022 - os: windows-2022 - generator: 'Visual Studio 17 2022' - - steps: - - uses: actions/checkout@v2 - - - name: Configure - run: | - cmake -S . -B build_${{matrix.build_type}} ` - -A ${{matrix.arch}} ` - -DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} ` - -DCMAKE_CXX_EXTENSIONS=OFF ` - -DCMAKE_CXX_STANDARD=${{matrix.std}} ` - -DCMAKE_CXX_STANDARD_REQUIRED=ON ` - -DCMAKE_INSTALL_PREFIX:PATH=./install ` - -DWITH_CUSTOM_PREFIX=${{matrix.extra == 'custom-prefix'}} ` - -G "${{matrix.generator}}" - - - name: Build - run: cmake --build build_${{matrix.build_type}} ` - --config ${{matrix.build_type}} - - - name: Test - env: - CTEST_OUTPUT_ON_FAILURE: 1 - run: | - cmake --build build_${{matrix.build_type}}/ ` - --config ${{matrix.build_type}} ` - --target RUN_TESTS - - - name: Install - run: | - cmake --build build_${{matrix.build_type}}/ ` - --config ${{matrix.build_type}} ` - --target install - - build-mingw: - name: ${{matrix.sys}}-${{matrix.env}}-C++${{matrix.std}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.extra}} - runs-on: windows-latest - defaults: - run: - shell: msys2 {0} - strategy: - fail-fast: false - matrix: - build_type: [Debug, Release] - extra: [no-custom-prefix, custom-prefix] - lib: [shared, static] - std: [98, 11, 14, 17, 20] - sys: [mingw32, mingw64] - include: - - sys: mingw32 - env: i686 - - sys: mingw64 - env: x86_64 - - steps: - - uses: actions/checkout@v2 - - uses: msys2/setup-msys2@v2 - with: - msystem: ${{matrix.sys}} - install: >- - lcov - mingw-w64-${{matrix.env}}-cmake - mingw-w64-${{matrix.env}}-gcc - mingw-w64-${{matrix.env}}-gflags - mingw-w64-${{matrix.env}}-ninja - - - name: Configure - env: - CXXFLAGS: -Wall -Wextra -Wpedantic -Wsign-conversion -Wtautological-compare -Werror -Wno-error=variadic-macros -Wno-error=long-long - run: | - if [[ ${{matrix.build_type}} == "Debug" ]]; then - export CXXFLAGS="--coverage ${CXXFLAGS}" - fi - - cmake -S . -B build_${{matrix.build_type}}/ \ - -DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} \ - -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ - -DCMAKE_CXX_EXTENSIONS=OFF \ - -DCMAKE_CXX_STANDARD=${{matrix.std}} \ - -DCMAKE_CXX_STANDARD_REQUIRED=ON \ - -DCMAKE_INSTALL_PREFIX:PATH=./install \ - -DWITH_CUSTOM_PREFIX=${{matrix.extra == 'custom-prefix'}} \ - -G Ninja - - - name: Build - run: | - cmake --build build_${{matrix.build_type}}/ --config ${{matrix.build_type}} - - - name: Test - env: - CTEST_OUTPUT_ON_FAILURE: 1 - run: | - cmake --build build_${{matrix.build_type}}/ --config ${{matrix.build_type}} \ - --target test - - - name: Install - run: | - cmake --build build_${{matrix.build_type}}/ \ - --config ${{matrix.build_type}} \ - --target install - - - name: Generate Coverage - if: ${{ startswith(matrix.build_type, 'Debug') }} - run: | - lcov --directory . --capture --output-file coverage.info - lcov --remove coverage.info \ - '*/install/include/*' \ - '*/msys64/mingw32/*' \ - '*/msys64/mingw64/*' \ - '*/src/*_unittest.cc' \ - '*/src/googletest.h' \ - '*/src/mock-log.h' \ - --output-file coverage.info - - for file in src/glog/*.h.in; do - name=$(basename ${file}) - name_we=${name%.h.in} - sed -i "s|build_${{matrix.build_type}}/glog/${name_we}.h\$|${file}|g" coverage.info - done - - lcov --list coverage.info - - - name: Upload Coverage to Coveralls - if: ${{ startswith(matrix.build_type, 'Debug') }} - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: ./coverage.info - flag-name: ${{matrix.sys}}-${{matrix.env}}-C++${{matrix.std}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.extra}} - parallel: true - - finish: - needs: build-mingw - runs-on: ubuntu-latest - - steps: - - name: Coveralls Finished - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - parallel-finished: true diff --git a/README.rst b/README.rst index b55f36441..a075e9b3a 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ Google Logging Library ====================== -|Linux Github actions| |Windows Github actions| |macOS Github actions| |Total alerts| |Language grade: C++| |Coveralls| +|Github actions| |Total alerts| |Language grade: C++| |Coveralls| Google Logging (glog) is a C++98 library that implements application-level logging. The library provides logging APIs based on C++-style streams and @@ -865,11 +865,7 @@ Submitting a Patch request `__. -.. |Linux Github actions| image:: https://github.com/google/glog/actions/workflows/linux-builds.yml/badge.svg - :target: https://github.com/google/glog/actions -.. |Windows Github actions| image:: https://github.com/google/glog/actions/workflows/windows-builds.yml/badge.svg - :target: https://github.com/google/glog/actions -.. |macOS Github actions| image:: https://github.com/google/glog/actions/workflows/macos-builds.yml/badge.svg +.. |Github actions| image:: https://github.com/google/glog/actions/workflows/builds.yml/badge.svg :target: https://github.com/google/glog/actions .. |Total alerts| image:: https://img.shields.io/lgtm/alerts/g/google/glog.svg?logo=lgtm&logoWidth=18 :target: https://lgtm.com/projects/g/google/glog/alerts/