diff --git a/.github/workflows/sanitisers.yml b/.github/workflows/sanitisers.yml index ea646f44b..1a0fd87a3 100644 --- a/.github/workflows/sanitisers.yml +++ b/.github/workflows/sanitisers.yml @@ -7,6 +7,10 @@ on: branches: [master] types: [opened, synchronize, reopened, ready_for_review] +defaults: + run: + shell: bash + jobs: conan-cache: if: github.event.pull_request.draft == false @@ -37,12 +41,10 @@ jobs: id: get-conan-version run: | echo "::set-output name=conan-version::$(conan --version | tr -d '[:alpha:] ')" - shell: bash - name: Hash ExternalProjects id: hash-external run: | echo "::set-output name=hash-external::$(sha256sum cmake/ExternalProjects.cmake | cut '-d ' -f 1)" - shell: bash - uses: actions/cache@v2 with: path: '~/.conan' @@ -84,12 +86,10 @@ jobs: id: get-conan-version run: | echo "::set-output name=conan-version::$(conan --version | tr -d '[:alpha:] ')" - shell: bash - name: Hash ExternalProjects id: hash-external run: | echo "::set-output name=hash-external::$(sha256sum cmake/ExternalProjects.cmake | cut '-d ' -f 1)" - shell: bash - uses: actions/cache@v2 with: path: '~/.conan' @@ -136,12 +136,10 @@ jobs: id: get-conan-version run: | echo "::set-output name=conan-version::$(conan --version | tr -d '[:alpha:] ')" - shell: bash - name: Hash ExternalProjects id: hash-external run: | echo "::set-output name=hash-external::$(sha256sum cmake/ExternalProjects.cmake | cut '-d ' -f 1)" - shell: bash - uses: actions/cache@v2 with: path: '~/.conan' @@ -189,12 +187,10 @@ jobs: id: get-conan-version run: | echo "::set-output name=conan-version::$(conan --version | tr -d '[:alpha:] ')" - shell: bash - name: Hash ExternalProjects id: hash-external run: | echo "::set-output name=hash-external::$(sha256sum cmake/ExternalProjects.cmake | cut '-d ' -f 1)" - shell: bash - uses: actions/cache@v2 with: path: '~/.conan' @@ -242,12 +238,10 @@ jobs: id: get-conan-version run: | echo "::set-output name=conan-version::$(conan --version | tr -d '[:alpha:] ')" - shell: bash - name: Hash ExternalProjects id: hash-external run: | echo "::set-output name=hash-external::$(sha256sum cmake/ExternalProjects.cmake | cut '-d ' -f 1)" - shell: bash - uses: actions/cache@v2 with: path: '~/.conan' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 59ebfbfd0..29dada0cd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,6 +7,10 @@ on: branches: [master] types: [opened, synchronize, reopened, ready_for_review] +defaults: + run: + shell: bash + jobs: formatting: if: github.event.pull_request.draft == false @@ -61,6 +65,22 @@ jobs: # --- 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 }}- # --- Tests build - need a debug build for actually running tests --- - name: "Run cmake for tests" run: inv dev.cmake --build=Debug @@ -78,6 +98,30 @@ jobs: # --- Code update --- - name: "Check out code" uses: actions/checkout@v2 + # --- Cache based on Conan version and ExternalProjects cmake source + - name: "Get Conan version" + id: get-conan-version + run: | + docker-compose run --rm cli conan --version 2>/tmp/conan-ver-log | tee /tmp/conan-ver + grep 'Conan version' /tmp/conan-ver || exit 1 + sudo chown -R $(id -u):$(id -g) ~/.conan + echo "::set-output name=conan-version::$(grep 'Conan version' /tmp/conan-ver | tr -d '[:alpha:] ')" + env: + CONAN_CACHE_MOUNT_SOURCE: ~/.conan/ + - name: "Get Conan Version - Show Log" + if: always() + run: cat /tmp/conan-ver-log + - 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 and test --- - name: "Build distributed tests" run: ./dist-test/build.sh @@ -105,6 +149,23 @@ jobs: run: git fetch origin ${GITHUB_REF}:ci-branch - name: "Check out branch" run: git checkout --force ci-branch + # --- 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: release-${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}-${{ steps.hash-external.outputs.hash-external }} + restore-keys: | + release-${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}-${{ steps.hash-external.outputs.hash-external }} + release-${{ runner.os }}-${{ steps.get-conan-version.outputs.conan-version }}- + release-${{ runner.os }}- # --- Examples --- - name: "Run cmake shared" run: inv dev.cmake --shared --build=Release diff --git a/dist-test/build.sh b/dist-test/build.sh index bad5ebf85..724e4f5eb 100755 --- a/dist-test/build.sh +++ b/dist-test/build.sh @@ -5,6 +5,10 @@ set -e export PROJ_ROOT=$(dirname $(dirname $(readlink -f $0))) pushd ${PROJ_ROOT} >> /dev/null +export CONAN_CACHE_MOUNT_SOURCE=$HOME/.conan/ +# Ensure the cache directory exists before starting the containers +mkdir -p ${CONAN_CACHE_MOUNT_SOURCE} + # Run the build docker-compose \ run \ diff --git a/dist-test/run.sh b/dist-test/run.sh index 1676ff52e..9f3f596c3 100755 --- a/dist-test/run.sh +++ b/dist-test/run.sh @@ -3,6 +3,7 @@ export PROJ_ROOT=$(dirname $(dirname $(readlink -f $0))) pushd ${PROJ_ROOT} >> /dev/null +export CONAN_CACHE_MOUNT_SOURCE=$HOME/.conan/ RETURN_VAL=0 # Run the test server in the background diff --git a/docker-compose.yml b/docker-compose.yml index fdd6900c4..c9840afac 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: - /usr/bin/docker:/usr/bin/docker - ./:/code/faabric - ./build:/build/faabric - - ./conan-cache/:/root/.conan + - ${CONAN_CACHE_MOUNT_SOURCE:-./conan-cache/}:/root/.conan working_dir: /code/faabric stdin_open: true tty: true diff --git a/thread-sanitizer-ignorelist.txt b/thread-sanitizer-ignorelist.txt index b8f2d8b3b..bed1f6834 100644 --- a/thread-sanitizer-ignorelist.txt +++ b/thread-sanitizer-ignorelist.txt @@ -11,3 +11,6 @@ signal:* # TODO: Remove: There's something weird going on with MPI code I don't understand race:faabric::scheduler::MpiWorld::* + +# Known Bug num. 1 in #189 +race:faabric::transport::PointToPointGroup::*