Skip to content

Commit

Permalink
cache for dist tests as well
Browse files Browse the repository at this point in the history
  • Loading branch information
csegarragonz committed Nov 30, 2021
1 parent d86a12d commit 3443f01
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,32 @@ 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 faabric conan --version 2>/tmp/conan-ver-log | tee /tmp/conan-ver
grep 'Conan version' /tmp/conan-ver || exit 1
echo "::set-output name=conan-version::$(grep 'Conan version' /tmp/conan-ver | tr -d '[:alpha:] ')"
shell: bash
env:
FAASM_BUILD_MOUNT: /build/faasm
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)"
shell: bash
- 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
Expand Down
4 changes: 4 additions & 0 deletions dist-test/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions dist-test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3443f01

Please sign in to comment.