mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 09:38:39 +08:00
feat: [skip e2e] effective way to use cache (#35598)
issue: https://github.com/milvus-io/milvus/issues/34876 Signed-off-by: Yellow Shine <sammy.huang@zilliz.com>
This commit is contained in:
parent
ed4eaffc9d
commit
2b6e6f4040
7
.github/actions/cache-save/action.yaml
vendored
7
.github/actions/cache-save/action.yaml
vendored
@ -12,13 +12,6 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- 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}"
|
|
||||||
shell: bash
|
|
||||||
- name: Cache CCache Volumes
|
- name: Cache CCache Volumes
|
||||||
if: ${{ inputs.kind == 'all' || inputs.kind == 'cpp' }}
|
if: ${{ inputs.kind == 'all' || inputs.kind == 'cpp' }}
|
||||||
uses: actions/cache/save@v4
|
uses: actions/cache/save@v4
|
||||||
|
|||||||
30
.github/actions/macos-cache-restore/action.yaml
vendored
Normal file
30
.github/actions/macos-cache-restore/action.yaml
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
name: 'Milvus Cache'
|
||||||
|
description: ''
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- 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}"
|
||||||
|
shell: bash
|
||||||
|
- name: Mac Cache CCache Volumes
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: /var/tmp/ccache
|
||||||
|
key: macos-ccache-${{ env.corehash }}
|
||||||
|
restore-keys: macos-ccache-
|
||||||
|
- name: Mac Cache Go Mod Volumes
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: ~/go/pkg/mod
|
||||||
|
key: macos-go-mod-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: macos-go-mod-
|
||||||
|
- name: Mac Cache Conan Packages
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: ~/.conan
|
||||||
|
key: macos-conan-${{ hashFiles('internal/core/conanfile.*') }}
|
||||||
|
restore-keys: macos-conan-
|
||||||
40
.github/actions/macos-cache-save/action.yaml
vendored
Normal file
40
.github/actions/macos-cache-save/action.yaml
vendored
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
name: 'Milvus Cache'
|
||||||
|
description: ''
|
||||||
|
inputs:
|
||||||
|
os:
|
||||||
|
description: 'OS name'
|
||||||
|
required: true
|
||||||
|
default: 'ubuntu20.04'
|
||||||
|
kind:
|
||||||
|
description: 'Cache kind'
|
||||||
|
required: false
|
||||||
|
default: 'all'
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- 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}"
|
||||||
|
shell: bash
|
||||||
|
- name: Mac Cache CCache Volumes
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: /var/tmp/ccache
|
||||||
|
key: macos-ccache-${{ env.corehash }}
|
||||||
|
restore-keys: macos-ccache-
|
||||||
|
- name: Mac Cache Go Mod Volumes
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: ~/go/pkg/mod
|
||||||
|
key: macos-go-mod-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: macos-go-mod-
|
||||||
|
- name: Mac Cache Conan Packages
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: ~/.conan
|
||||||
|
key: macos-conan-${{ hashFiles('internal/core/conanfile.*') }}
|
||||||
|
restore-keys: macos-conan-
|
||||||
|
|
||||||
29
.github/workflows/mac.yaml
vendored
29
.github/workflows/mac.yaml
vendored
@ -38,18 +38,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
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 CCache Volumes
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: /var/tmp/ccache
|
|
||||||
key: macos-ccache-${{ env.corehash }}
|
|
||||||
restore-keys: macos-ccache-
|
|
||||||
- name: Setup Python environment
|
- name: Setup Python environment
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
@ -58,18 +46,8 @@ jobs:
|
|||||||
uses: actions/setup-go@v2.2.0
|
uses: actions/setup-go@v2.2.0
|
||||||
with:
|
with:
|
||||||
go-version: '~1.21.11'
|
go-version: '~1.21.11'
|
||||||
- name: Mac Cache Go Mod Volumes
|
- name: Download Caches
|
||||||
uses: actions/cache@v3
|
uses: ./.github/actions/macos-cache-restore
|
||||||
with:
|
|
||||||
path: ~/go/pkg/mod
|
|
||||||
key: macos-go-mod-${{ hashFiles('**/go.sum') }}
|
|
||||||
restore-keys: macos-go-mod-
|
|
||||||
- name: Mac Cache Conan Packages
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: ~/.conan
|
|
||||||
key: macos-conan-${{ hashFiles('internal/core/conanfile.*') }}
|
|
||||||
restore-keys: macos-conan-
|
|
||||||
- name: Code Check
|
- name: Code Check
|
||||||
env:
|
env:
|
||||||
CCACHE_DIR: /var/tmp/ccache
|
CCACHE_DIR: /var/tmp/ccache
|
||||||
@ -94,3 +72,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: cmake-log
|
name: cmake-log
|
||||||
path: cmake_build/CMakeFiles/*.log
|
path: cmake_build/CMakeFiles/*.log
|
||||||
|
- name: Save Caches
|
||||||
|
uses: ./.github/actions/macos-cache-save
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user