-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
230 additions
and
442 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Linux | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
defaults: | ||
run: | ||
shell: bash | ||
name: "GCC-C++${{matrix.std}}-${{matrix.build_type}} (shared: ${{matrix.shared}} custom prefix: ${{matrix.custom_prefix}})" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
build_type: [Release, Debug] | ||
std: [98, 11, 14, 17, 20] | ||
custom_prefix: [ON, OFF] | ||
shared: [ON, OFF] | ||
|
||
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: Configure | ||
run: | | ||
if [[ ${{matrix.build_type}} == "Debug" ]]; then | ||
export CXXFLAGS=--coverage | ||
fi | ||
cmake -S . -B build_${{matrix.build_type}} -G Ninja \ | ||
-DBUILD_SHARED_LIBS=${{matrix.shared}} \ | ||
-DCMAKE_CXX_STANDARD=${{matrix.std}} \ | ||
-DCMAKE_CXX_STANDARD_REQUIRED=ON \ | ||
-DCMAKE_PREFIX_PATH=./install \ | ||
-DWITH_CUSTOM_PREFIX=${{matrix.custom_prefix}} | ||
- name: Build | ||
run: | | ||
cmake --build build_${{matrix.build_type}} \ | ||
--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 | ||
lcov --list coverage.info | ||
# - name: Upload Coverage to Codecov | ||
# if: ${{ startswith(matrix.build_type, 'Debug') }} | ||
# uses: codecov/codecov-action@v2 | ||
# with: | ||
# token: ${{ secrets.CODECOV_TOKEN }} | ||
# fail_ci_if_error: true | ||
# verbose: true |
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.