mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-05 21:39:19 +08:00
3e5bc2e517
not allow to upload cache when job failure this PR is to fix issue like below: openblas/0.3.23@milvus/dev is locked by another concurrent conan process, wait... If not the case, quit, and do 'conan remove --locks' Error: The operation was canceled. Signed-off-by: Sammy Huang <sammy.huang@zilliz.com>
95 lines
2.9 KiB
YAML
95 lines
2.9 KiB
YAML
name: Mac Code Checker
|
|
|
|
# This workflow is triggered on pushes or pull request to the repository.
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
# file paths to consider in the event. Optional; defaults to all.
|
|
paths:
|
|
- 'scripts/**'
|
|
- 'internal/**'
|
|
- 'pkg/**'
|
|
- 'cmd/**'
|
|
- 'build/**'
|
|
- 'tests/integration/**'
|
|
- '.github/workflows/mac.yaml'
|
|
- '.env'
|
|
- docker-compose.yml
|
|
- Makefile
|
|
- '!**.md'
|
|
- '!build/ci/jenkins/**'
|
|
# FIXME(wxyu): not need to run code check, update the ci-passed rules and remove these two lines
|
|
- go.mod
|
|
- go.sum
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
mac:
|
|
name: Code Checker MacOS 12
|
|
runs-on: macos-12
|
|
timeout-minutes: 300
|
|
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 CCache Volumes
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /var/tmp/ccache
|
|
key: macos-ccache-${{ env.corehash }}
|
|
restore-keys: macos-ccache-
|
|
- name: Setup Python environment
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '<3.12'
|
|
- name: Setup Go environment
|
|
uses: actions/setup-go@v2.2.0
|
|
with:
|
|
go-version: '~1.20.7'
|
|
- name: Mac Cache Go Mod Volumes
|
|
uses: actions/cache@v3
|
|
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
|
|
env:
|
|
CCACHE_DIR: /var/tmp/ccache
|
|
CCACHE_COMPILERCHECK: content
|
|
CCACHE_COMPRESS: 1
|
|
CCACHE_COMPRESSLEVEL: 5
|
|
CCACHE_MAXSIZE: 2G
|
|
run: |
|
|
if [[ ! -d "/var/tmp/ccache" ]];then
|
|
mkdir -p /var/tmp/ccache
|
|
fi
|
|
ls -alh /var/tmp/ccache
|
|
brew install libomp ninja openblas ccache pkg-config
|
|
pip3 install conan==1.61.0
|
|
if [[ ! -d "/usr/local/opt/llvm" ]]; then
|
|
ln -s /usr/local/opt/llvm@14 /usr/local/opt/llvm
|
|
fi
|
|
make milvus
|
|
- name: Upload Cmake log
|
|
uses: actions/upload-artifact@v3
|
|
if: ${{ failure() }}
|
|
with:
|
|
name: cmake-log
|
|
path: cmake_build/CMakeFiles/*.log
|