Skip to content

Commit

Permalink
El.ci fixes (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
emlowe committed Aug 3, 2021
1 parent 32c7afa commit cd8e0bb
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 50 deletions.
123 changes: 77 additions & 46 deletions .github/workflows/build-test-cplusplus.yml
Expand Up @@ -3,14 +3,83 @@ name: Build and Test C++
on: [push, pull_request]

jobs:
build_wheels:
name: Build and Test C++ on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-latest]
valgrind:
name: valgrind ubuntu
runs-on: ubuntu-20.04
steps:

- name: Cancel previous runs on the same branch
if: ${{ github.ref != 'refs/heads/main' }}
uses: styfle/cancel-workflow-action@0.7.0
with:
access_token: ${{ github.token }}

- name: Checkout code
uses: actions/checkout@v2

- name: cmake, RunTests, and valgrind on ubuntu-20.04
run: |
sudo apt update
sudo apt-get install valgrind -y
mkdir build
cd build
cmake ../
cmake --build . -- -j 6
ctest -j 6 --output-on-failure
valgrind --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all ctest -j 6 --output-on-failure
asan:
name: ASAN ubuntu
runs-on: ubuntu-20.04
steps:

- name: Cancel previous runs on the same branch
if: ${{ github.ref != 'refs/heads/main' }}
uses: styfle/cancel-workflow-action@0.7.0
with:
access_token: ${{ github.token }}

- name: Checkout code
uses: actions/checkout@v2

- name: cmake, RunTests with address- and undefined sanitizer on Ubuntu
run: |
sudo fallocate -l 16G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
swapon -s
mkdir build-asan
cd build-asan
cmake -DCMAKE_BUILD_TYPE=ASAN ../
cmake --build . -- -j 6
swapon -s
./RunTests
tsan:
name: TSAN ubuntu
runs-on: ubuntu-20.04
steps:
- name: Cancel previous runs on the same branch
if: ${{ github.ref != 'refs/heads/main' }}
uses: styfle/cancel-workflow-action@0.7.0
with:
access_token: ${{ github.token }}

- name: Checkout code
uses: actions/checkout@v2

- name: cmake, RunTests with thread sanitizer on Ubuntu
run: |
mkdir build-tsan
cd build-tsan
cmake -DCMAKE_BUILD_TYPE=TSAN ../
cmake --build . -- -j 6
TSAN_OPTIONS="memory_limit_mb=6000" ./RunTests
windows:
name: Windows Latest
runs-on: windows-latest
steps:

- name: Cancel previous runs on the same branch
Expand All @@ -23,47 +92,9 @@ jobs:
uses: actions/checkout@v2

- name: cmake, RunTests with Windows
if: startsWith(matrix.os, 'windows')
run: |
mkdir build-win
cd build-win
cmake ..
cmake --build . --config Release -j 6
ctest -C Release -j 6
- name: cmake, RunTests, and valgrind on ${{ matrix.os }}
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt update
sudo apt-get install valgrind -y
sudo fallocate -l 16G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
mkdir build
cd build
cmake ../
cmake --build . -- -j 6
ctest -j 6 --output-on-failure
swapon -s
valgrind --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all ctest -j 6 --output-on-failure
- name: cmake, RunTests with address- and undefined sanitizer on Ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: |
mkdir build-asan
cd build-asan
cmake -DCMAKE_BUILD_TYPE=ASAN ../
cmake --build . -- -j 6
swapon -s
./RunTests
- name: cmake, RunTests with thread sanitizer on Ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: |
mkdir build-tsan
cd build-tsan
cmake -DCMAKE_BUILD_TYPE=TSAN ../
cmake --build . -- -j 6
swapon -s
./RunTests
ctest -C Release -j 6
8 changes: 4 additions & 4 deletions CMakeLists.txt
Expand Up @@ -88,14 +88,14 @@ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -g")
ENDIF()

IF (CMAKE_BUILD_TYPE STREQUAL "ASAN")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O1 -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O1 -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined")
set (CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined")
ENDIF()

IF (CMAKE_BUILD_TYPE STREQUAL "TSAN")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=thread")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer -fsanitize=thread")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -fno-omit-frame-pointer -fsanitize=thread")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -fno-omit-frame-pointer -fsanitize=thread")
set (CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=thread")
ENDIF()

Expand Down

0 comments on commit cd8e0bb

Please sign in to comment.