mac.yaml 2.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
name: 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/**'
      - 'cmd/**'
      - 'build/**'
      - '.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

jobs:
  mac:
    name: Code Checker MacOS 12
    runs-on: macos-12
    timeout-minutes: 60
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - 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 CCache Volumes
        uses: actions/cache@v3
        with:
          path: /var/tmp/ccache
          key: macos-ccache-${{ hashFiles('internal/core/**') }}
          restore-keys: macos-ccache-
      - name: Setup Go environment
        uses: actions/setup-go@v2.2.0
        with:
          go-version: '~1.18.1'
      - 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: Code Check
        env:
          CCACHE_DIR: /var/tmp/ccache
          CCACHE_COMPILERCHECK: content
          CCACHE_COMPRESS: 1
          CCACHE_COMPRESSLEVEL: 5
          CCACHE_MAXSIZE: 2G
          CUSTOM_THIRDPARTY_PATH: /tmp/thirdparty          
        run: |
          if [[ ! -d "/var/tmp/ccache" ]];then
            mkdir -p /var/tmp/ccache
          fi
          brew install boost libomp ninja tbb openblas ccache
          if [[ ! -d "/usr/local/opt/llvm" ]]; then
            ln -s /usr/local/opt/llvm@13 /usr/local/opt/llvm
          fi
          make milvus && sh scripts/collect_arrow_dep.sh -f /tmp/thirdparty