Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use matrix build for sanitisers #208

Merged
merged 2 commits into from
Dec 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
258 changes: 0 additions & 258 deletions .github/workflows/sanitisers.yml

This file was deleted.

56 changes: 55 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,50 @@ defaults:
shell: bash

jobs:
conan-cache:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
env:
HOST_TYPE: ci
REDIS_QUEUE_HOST: redis
REDIS_STATE_HOST: redis
container:
image: faasm/faabric:0.2.3
defaults:
run:
working-directory: /code/faabric
services:
redis:
image: redis
steps:
# --- Code update ---
- name: "Fetch ref"
run: git fetch origin ${GITHUB_REF}:ci-branch
- name: "Check out branch"
run: git checkout --force ci-branch
# --- Set-up ---
- name: "Ping redis"
run: redis-cli -h redis ping
# --- Cache based on Conan version and ExternalProjects cmake source
- name: Get Conan version
id: get-conan-version
run: |
echo "::set-output name=conan-version::$(conan --version | tr -d '[:alpha:] ')"
- name: Hash ExternalProjects
id: hash-external
run: |
echo "::set-output name=hash-external::$(sha256sum cmake/ExternalProjects.cmake | cut '-d ' -f 1)"
- uses: actions/cache@v2
with:
path: '~/.conan'
key: ${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}-${{ steps.hash-external.outputs.hash-external }}
restore-keys: |
${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}-
${{ runner.os }}-
# --- Build dependencies
- name: "Build dependencies to be shared by all sanitiser runs"
run: inv dev.cmake -b Debug

formatting:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
Expand Down Expand Up @@ -43,11 +87,19 @@ jobs:

tests:
if: github.event.pull_request.draft == false
needs: [conan-cache]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sanitiser: [None, Address, Thread, Undefined, Leak]
env:
HOST_TYPE: ci
REDIS_QUEUE_HOST: redis
REDIS_STATE_HOST: redis
ASAN_OPTIONS: "verbosity=1:halt_on_error=1"
TSAN_OPTIONS: "verbosity=1:halt_on_error=1:suppressions=/code/faabric/thread-sanitizer-ignorelist.txt:history_size=7"
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
container:
image: faasm/faabric:0.2.3
defaults:
Expand Down Expand Up @@ -83,7 +135,7 @@ jobs:
${{ runner.os }}-
# --- Tests build - need a debug build for actually running tests ---
- name: "Run cmake for tests"
run: inv dev.cmake --build=Debug
run: inv dev.cmake --build=Debug --sanitiser ${{ matrix.sanitiser }}
- name: "Build tests"
run: inv dev.cc faabric_tests
# --- Tests ---
Expand All @@ -93,6 +145,7 @@ jobs:

dist-tests:
if: github.event.pull_request.draft == false
needs: [conan-cache]
runs-on: ubuntu-latest
steps:
# --- Code update ---
Expand Down Expand Up @@ -130,6 +183,7 @@ jobs:

examples:
if: github.event.pull_request.draft == false
needs: [conan-cache]
runs-on: ubuntu-latest
env:
HOST_TYPE: ci
Expand Down
6 changes: 3 additions & 3 deletions tasks/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


@task
def cmake(ctx, clean=False, shared=False, build="Debug", sanitise_mode="None"):
def cmake(ctx, clean=False, shared=False, build="Debug", sanitiser="None"):
"""
Configures the build
"""
Expand All @@ -40,7 +40,7 @@ def cmake(ctx, clean=False, shared=False, build="Debug", sanitise_mode="None"):
"-DBUILD_SHARED_LIBS={}".format("ON" if shared else "OFF"),
"-DCMAKE_CXX_COMPILER=/usr/bin/clang++-13",
"-DCMAKE_C_COMPILER=/usr/bin/clang-13",
"-DFAABRIC_USE_SANITISER={}".format(sanitise_mode),
"-DFAABRIC_USE_SANITISER={}".format(sanitiser),
PROJ_ROOT,
]

Expand Down Expand Up @@ -92,7 +92,7 @@ def sanitise(ctx, mode, target="faabric_tests", noclean=False, shared=False):
clean=(not noclean),
shared=shared,
build="Debug",
sanitise_mode=mode,
sanitiser=mode,
)

cc(ctx, target, shared=shared)