2022-10-23 08:41:33 +08:00
|
|
|
name: Mac Code Checker
|
2022-08-03 20:18:36 +08:00
|
|
|
|
|
|
|
# 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/**'
|
2023-04-11 10:32:31 +08:00
|
|
|
- 'pkg/**'
|
2024-05-13 10:25:32 +08:00
|
|
|
- 'client/**'
|
2022-08-03 20:18:36 +08:00
|
|
|
- 'cmd/**'
|
|
|
|
- 'build/**'
|
2023-05-23 21:09:28 +08:00
|
|
|
- 'tests/integration/**'
|
2022-08-03 20:18:36 +08:00
|
|
|
- '.github/workflows/mac.yaml'
|
|
|
|
- '.env'
|
|
|
|
- docker-compose.yml
|
|
|
|
- Makefile
|
|
|
|
- '!**.md'
|
|
|
|
- '!build/ci/jenkins/**'
|
2023-04-19 16:52:30 +08:00
|
|
|
# FIXME(wxyu): not need to run code check, update the ci-passed rules and remove these two lines
|
2022-08-03 20:18:36 +08:00
|
|
|
- go.mod
|
|
|
|
- go.sum
|
|
|
|
|
2023-12-14 11:30:38 +08:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
2024-01-09 18:28:48 +08:00
|
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
2023-12-14 11:30:38 +08:00
|
|
|
|
2022-08-03 20:18:36 +08:00
|
|
|
jobs:
|
|
|
|
mac:
|
|
|
|
name: Code Checker MacOS 12
|
|
|
|
runs-on: macos-12
|
2023-10-24 17:50:10 +08:00
|
|
|
timeout-minutes: 300
|
2022-08-03 20:18:36 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2023-04-19 16:52:30 +08:00
|
|
|
- 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
|
2023-12-25 16:34:46 +08:00
|
|
|
uses: actions/cache@v3
|
2023-04-19 16:52:30 +08:00
|
|
|
with:
|
|
|
|
path: /var/tmp/ccache
|
|
|
|
key: macos-ccache-${{ env.corehash }}
|
|
|
|
restore-keys: macos-ccache-
|
2023-11-06 17:34:19 +08:00
|
|
|
- name: Setup Python environment
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: '<3.12'
|
2022-08-03 20:18:36 +08:00
|
|
|
- name: Setup Go environment
|
|
|
|
uses: actions/setup-go@v2.2.0
|
|
|
|
with:
|
2024-08-05 17:28:26 +08:00
|
|
|
go-version: '~1.21.11'
|
2022-08-03 20:18:36 +08:00
|
|
|
- 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-
|
2022-11-23 10:39:11 +08:00
|
|
|
- name: Mac Cache Conan Packages
|
2023-12-25 16:34:46 +08:00
|
|
|
uses: actions/cache@v3
|
2022-11-23 10:39:11 +08:00
|
|
|
with:
|
2023-04-19 16:52:30 +08:00
|
|
|
path: ~/.conan
|
|
|
|
key: macos-conan-${{ hashFiles('internal/core/conanfile.*') }}
|
|
|
|
restore-keys: macos-conan-
|
2022-08-03 20:18:36 +08:00
|
|
|
- name: Code Check
|
|
|
|
env:
|
2023-04-19 16:52:30 +08:00
|
|
|
CCACHE_DIR: /var/tmp/ccache
|
|
|
|
CCACHE_COMPILERCHECK: content
|
|
|
|
CCACHE_COMPRESS: 1
|
|
|
|
CCACHE_COMPRESSLEVEL: 5
|
|
|
|
CCACHE_MAXSIZE: 2G
|
2022-08-03 20:18:36 +08:00
|
|
|
run: |
|
2023-04-19 16:52:30 +08:00
|
|
|
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
|
2024-08-02 19:26:15 +08:00
|
|
|
pip3 install conan==1.64.1
|
2022-08-03 20:18:36 +08:00
|
|
|
if [[ ! -d "/usr/local/opt/llvm" ]]; then
|
2022-10-08 14:02:57 +08:00
|
|
|
ln -s /usr/local/opt/llvm@14 /usr/local/opt/llvm
|
2022-08-03 20:18:36 +08:00
|
|
|
fi
|
2022-11-23 10:39:11 +08:00
|
|
|
make milvus
|
2022-10-08 11:52:58 +08:00
|
|
|
- name: Upload Cmake log
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
if: ${{ failure() }}
|
|
|
|
with:
|
|
|
|
name: cmake-log
|
2022-11-23 10:39:11 +08:00
|
|
|
path: cmake_build/CMakeFiles/*.log
|