Skip to content

Commit

Permalink
Use conan action (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shillaker authored Feb 10, 2022
1 parent 51f6a25 commit 84fdcdf
Showing 1 changed file with 9 additions and 85 deletions.
94 changes: 9 additions & 85 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,62 +15,26 @@ 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.4
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
- uses: faasm/conan-cache-action@v1
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"
directory: /code/faabric
- name: "Build dependencies to be shared by all runs"
run: inv dev.cmake -b Debug

formatting:
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.4
defaults:
run:
working-directory: /code/faabric
services:
redis:
image: redis
steps:
# --- Code update ---
- name: "Fetch ref"
Expand Down Expand Up @@ -109,36 +73,15 @@ jobs:
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 ---
- uses: faasm/conan-cache-action@v1
with:
directory: /code/faabric
- 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 --sanitiser ${{ matrix.sanitiser }}
- name: "Build tests"
run: inv dev.cc faabric_tests
# --- Tests ---
- name: "Run tests"
run: ./bin/faabric_tests
working-directory: /build/faabric/static
Expand Down Expand Up @@ -198,29 +141,10 @@ jobs:
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
# --- 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
- uses: faasm/conan-cache-action@v1
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 ---
build-type: "release"
directory: /code/faabric
- name: "Run cmake shared"
run: inv dev.cmake --shared --build=Release
- name: "Build Faabric shared library"
Expand Down

0 comments on commit 84fdcdf

Please sign in to comment.