Skip to content

Commit

Permalink
Add a GitHub Action for Ubuntu builds
Browse files Browse the repository at this point in the history
The actions tests both g++ 5.5 and clang++ 6, with ubsan, asan and
Valgrind memcheck.

[ci skip]
  • Loading branch information
Morwenn committed Jan 4, 2021
1 parent 81bde27 commit 1de7526
Showing 1 changed file with 101 additions and 0 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/build-ubuntu.yml
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;

0 comments on commit 1de7526

Please sign in to comment.