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 conan action in GHA #225

Merged
merged 1 commit into from
Feb 10, 2022
Merged
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
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