Skip to content

test: update macos github runner cache #49673

test: update macos github runner cache

test: update macos github runner cache #49673

Workflow file for this run

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/**'
- 'client/**'
- 'cmd/**'
- 'build/**'
- 'tests/integration/**'
- 'tests/go_client/**'
- '.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
schedule:
# Runs at 17:00 UTC every day, for refreshing cache every day
- cron: '0 17 * * *'
workflow_dispatch:
inputs:
branch:
description: 'Branch to run the workflow on'
required: true
default: 'master'
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
mac:
name: Code Checker MacOS
runs-on: macos-15-intel
timeout-minutes: 480
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch || github.ref }}
- name: Setup Python environment
uses: actions/setup-python@v4
with:
python-version: '<3.12'
- name: Install CMake 3.31.8
run: |
cmake --version || true
which cmake || true
if ! brew list cmake &>/dev/null; then
brew uninstall cmake -f
fi
curl -LO https://github.com/Kitware/CMake/releases/download/v3.31.8/cmake-3.31.8-macos-universal.tar.gz
tar -zxf cmake-3.31.8-macos-universal.tar.gz -C /tmp/
sudo mv /tmp/cmake-3.31.8-macos-universal/CMake.app /Applications/
sudo rm -f /usr/local/bin/cmake /usr/local/bin/cpack /usr/local/bin/ctest
sudo rm -f /opt/homebrew/bin/cmake /opt/homebrew/bin/cpack /opt/homebrew/bin/ctest
echo -e "\n=== Creating symlinks for CMake ==="
sudo ln -s /Applications/CMake.app/Contents/bin/cmake /usr/local/bin/cmake
sudo ln -s /Applications/CMake.app/Contents/bin/cpack /usr/local/bin/cpack
sudo ln -s /Applications/CMake.app/Contents/bin/ctest /usr/local/bin/ctest
CMAKE_MODULE_DIR="/Applications/CMake.app/Contents/share/cmake-3.31"
sudo ln -s "$CMAKE_MODULE_DIR" /usr/local/share/cmake-3.31
export PATH="/usr/local/bin:$PATH"
cmake --version
which cmake
- name: Setup Go environment
uses: actions/setup-go@v4
with:
go-version: '1.24.9'
cache: false
- name: Download Caches
uses: ./.github/actions/macos-cache-restore
- name: Code Check
env:
CCACHE_DIR: /var/tmp/ccache
CCACHE_COMPILERCHECK: content
CCACHE_COMPRESS: 1
CCACHE_COMPRESSLEVEL: 9
CCACHE_MAXSIZE: 1G
run: |
if [[ ! -d "/var/tmp/ccache" ]];then
mkdir -p /var/tmp/ccache
fi
brew install libomp ninja openblas ccache pkg-config
BREW_PREFIX=$(brew --prefix)
# Install llvm@17 explicitly as a stable version
brew install llvm@17
if [[ ! -d "${BREW_PREFIX}/opt/llvm" ]]; then
ln -s ${BREW_PREFIX}/opt/llvm@17 ${BREW_PREFIX}/opt/llvm
fi
pip3 install conan==1.64.1
make milvus
- name: Upload Cmake log
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: cmake-log
path: cmake_build/CMakeFiles/*.log
- name: Save Caches
uses: ./.github/actions/macos-cache-save
#if: github.event_name != 'pull_request'