From e19e364c218515e1cbb6c9ade07182ca6c614f62 Mon Sep 17 00:00:00 2001 From: Jenny Li Date: Sun, 23 Oct 2022 08:41:33 +0800 Subject: [PATCH] [skip e2e] Try to improve mac compile (#19992) Signed-off-by: Jenny Li Signed-off-by: Jenny Li --- .github/workflows/code-checker.yaml | 16 ++++++++++++++-- .github/workflows/mac.yaml | 18 +++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/workflows/code-checker.yaml b/.github/workflows/code-checker.yaml index 1682d64777..b8558de4c2 100644 --- a/.github/workflows/code-checker.yaml +++ b/.github/workflows/code-checker.yaml @@ -39,11 +39,17 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: "Generate CCache Hash" + env: + CORE_HASH: ${{ hashFiles( 'internal/core/**/*.cpp', 'internal/core/**/*.cc', 'internal/core/**/*.c', 'internal/core/**/*.h', 'internal/core/**/*.hpp', 'internal/core/**/CMakeLists.txt') }} + run: | + echo "corehash=${CORE_HASH}" >> $GITHUB_ENV + echo "Set CCache hash to ${CORE_HASH}" - name: Cache CCache Volumes uses: actions/cache@v3 with: path: .docker/amd64-ubuntu20.04-ccache - key: ubuntu20.04-ccache-${{ hashFiles('internal/core/**') }} + key: ubuntu20.04-ccache-${{ env.corehash }} restore-keys: ubuntu20.04-ccache- - name: Cache Third Party uses: actions/cache@v3 @@ -71,11 +77,17 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: "Generate CCache Hash" + env: + CORE_HASH: ${{ hashFiles( 'internal/core/**/*.cpp', 'internal/core/**/*.cc', 'internal/core/**/*.c', 'internal/core/**/*.h', 'internal/core/**/*.hpp', 'internal/core/**/CMakeLists.txt') }} + run: | + echo "corehash=${CORE_HASH}" >> $GITHUB_ENV + echo "Set CCache hash to ${CORE_HASH}" - name: Cache CCache Volumes uses: actions/cache@v3 with: path: .docker/amd64-centos7-ccache - key: centos7-ccache-${{ hashFiles('internal/core/**') }} + key: centos7-ccache-${{ env.corehash }} restore-keys: centos7-ccache- - name: Cache Third Party uses: actions/cache@v3 diff --git a/.github/workflows/mac.yaml b/.github/workflows/mac.yaml index e629178f76..820aa3a4fa 100644 --- a/.github/workflows/mac.yaml +++ b/.github/workflows/mac.yaml @@ -1,4 +1,4 @@ -name: Code Checker +name: Mac Code Checker # This workflow is triggered on pushes or pull request to the repository. on: @@ -30,19 +30,31 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: "Generate CCache Hash" + env: + CORE_HASH: ${{ hashFiles( 'internal/core/**/*.cpp', 'internal/core/**/*.cc', 'internal/core/**/*.c', 'internal/core/**/*.h', 'internal/core/**/*.hpp', 'internal/core/**/CMakeLists.txt') }} + run: | + echo "corehash=${CORE_HASH}" >> $GITHUB_ENV + echo "Set CCache hash to ${CORE_HASH}" - name: Mac Cache Third Party uses: actions/cache@v3 with: path: | /tmp/thirdparty - cmake_build/3rdparty_download/download key: macos-thirdparty-${{ hashFiles('internal/core/thirdparty/**') }} restore-keys: macos-thirdparty- + - name: Mac Cache Cmake Build + uses: actions/cache@v3 + with: + path: | + cmake_build/3rdparty_download/download + key: macos-cmake-build-${{ env.corehash }} + restore-keys: macos-cmake-build- - name: Mac Cache CCache Volumes uses: actions/cache@v3 with: path: /var/tmp/ccache - key: macos-ccache-${{ hashFiles('internal/core/**') }} + key: macos-ccache-${{ env.corehash }} restore-keys: macos-ccache- - name: Setup Go environment uses: actions/setup-go@v2.2.0