-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a GitHub Action for Ubuntu builds
The actions tests both g++ 5.5 and clang++ 6, with ubsan, asan and Valgrind memcheck. [ci skip]
- Loading branch information
Showing
1 changed file
with
101 additions
and
0 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,101 @@ | ||
# Copyright (c) 2021 Morwenn | ||
# SPDX-License-Identifier: MIT | ||
|
||
name: Ubuntu Builds | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'CMakeLists.txt' | ||
- 'cmake/**' | ||
- 'examples/**' | ||
- 'include/**' | ||
- 'testsuite/**' | ||
pull_request: | ||
paths: | ||
- 'CMakeLists.txt' | ||
- 'cmake/**' | ||
- 'examples/**' | ||
- 'include/**' | ||
- 'testsuite/**' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-16.04 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Default configuration corresponds to a release | ||
# build without additional tooling, also provides | ||
# default options for other builds | ||
cxx: | ||
- g++-5 | ||
- clang++-6.0 | ||
build_type: [Release] | ||
sanitize: [''] | ||
valgrind: [OFF] | ||
|
||
# Below are debug builds with tooling | ||
include: | ||
# GCC builds | ||
- cxx: g++-5 | ||
build_type: Debug | ||
valgrind: ON | ||
- cxx: g++-5 | ||
build_type: Debug | ||
sanitize: address | ||
- cxx: g++-5 | ||
build_type: Debug | ||
sanitize: undefined | ||
# Clang builds | ||
- cxx: clang++-6.0 | ||
build_type: Debug | ||
valgrind: ON | ||
- cxx: clang++-6.0 | ||
build_type: Debug | ||
sanitize: address | ||
- cxx: clang++-6.0 | ||
build_type: Debug | ||
sanitize: undefined | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install Valgrind | ||
if: ${{matrix.valgrind == 'ON'}} | ||
run: sudo apt install -y valgrind | ||
|
||
- name: Configure CMake | ||
working-directory: ${{runner.workspace}} | ||
env: | ||
CXX: ${{matrix.cxx}} | ||
run: | | ||
cmake -H${{github.event.repository.name}} -Bbuild \ | ||
-DCMAKE_CONFIGURATION_TYPES=${{matrix.build_type}} \ | ||
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ | ||
-DSANITIZE=${{matrix.sanitize}} \ | ||
-DUSE_VALGRIND=${{matrix.valgrind}} \ | ||
-G"Unix Makefiles" \ | ||
-DBUILD_EXAMPLES=ON | ||
- name: Build the test suite | ||
shell: bash | ||
working-directory: ${{runner.workspace}}/build | ||
run: cmake --build . --config ${{matrix.build_type}} -j 2 | ||
|
||
- name: Run the test suite with Memcheck | ||
if: ${{matrix.valgrind != 'ON'}} | ||
env: | ||
CTEST_OUTPUT_ON_FAILURE: 1 | ||
working-directory: ${{runner.workspace}}/build | ||
run: ctest -C ${{matrix.build_type}} | ||
|
||
- name: Run the test suite | ||
if: ${{matrix.valgrind == 'ON'}} | ||
env: | ||
CTEST_OUTPUT_ON_FAILURE: 1 | ||
working-directory: ${{runner.workspace}}/build | ||
run: | | ||
ctest -T memcheck -C ${{matrix.build_type}} -j 2 | ||
find ./Testing/Temporary -name "MemoryChecker.*.log" -size +1300c | xargs cat; |