From 84fdcdfaa56363d9489d6f7d838a7db2160c261f Mon Sep 17 00:00:00 2001 From: Simon Shillaker <554768+Shillaker@users.noreply.github.com> Date: Thu, 10 Feb 2022 10:34:45 +0100 Subject: [PATCH] Use conan action (#225) --- .github/workflows/tests.yml | 94 ++++--------------------------------- 1 file changed, 9 insertions(+), 85 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 23504bc19..367983989 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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" @@ -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 @@ -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"