Fix package workflow #640
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and test | |
| on: | |
| push: | |
| # file paths to consider in the event. Optional; defaults to all. | |
| paths: | |
| - 'cmake/**' | |
| - 'examples/**' | |
| - 'scripts/**' | |
| - 'src/**' | |
| - 'test/**' | |
| - 'thirdparty/**' | |
| - '.github/workflows/main.yaml' | |
| - '!**.md' | |
| - '.clang-format' | |
| - '.clang-tidy' | |
| pull_request: | |
| # file paths to consider in the event. Optional; defaults to all. | |
| paths: | |
| - 'cmake/**' | |
| - 'examples/**' | |
| - 'scripts/**' | |
| - 'src/**' | |
| - 'test/**' | |
| - 'thirdparty/**' | |
| - '.github/workflows/main.yaml' | |
| - '!**.md' | |
| - '.clang-format' | |
| - '.clang-tidy' | |
| jobs: | |
| linux: | |
| name: Build and test AMD64 ${{ matrix.os.distro }} ${{ matrix.os.version }} | |
| runs-on: ubuntu-latest | |
| container: ${{ matrix.os.image }} | |
| timeout-minutes: 75 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - distro: Ubuntu | |
| version: 20.04 | |
| image: ubuntu:20.04 | |
| key: u2004 | |
| - distro: Fedora | |
| version: 39 | |
| image: fedora:39 | |
| key: fc39 | |
| env: | |
| CCACHE_DIR: ${{ github.workspace }}/.ccache | |
| CCACHE_COMPILERCHECK: content | |
| CCACHE_COMPRESS: 1 | |
| CCACHE_COMPRESSLEVEL: 5 | |
| CCACHE_MAXSIZE: 2G | |
| steps: | |
| - name: Env | |
| run: echo "${HOME}/.local/bin" >> $GITHUB_PATH | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Cache ccache and conan | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ github.workspace }}/.ccache | |
| /github/home/.conan2 | |
| key: linux-${{ matrix.os.key }}-cache-${{ github.sha }} | |
| restore-keys: linux-${{ matrix.os.key }}-cache- | |
| - name: Prepare | |
| run: | | |
| sh scripts/install_deps.sh | |
| - name: Lint | |
| if: ${{ matrix.os.distro == 'Ubuntu' }} | |
| run: | | |
| make lint | |
| - name: Unit Testing | |
| run: | | |
| make test | |
| integration-test: | |
| name: Integration test | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 75 | |
| env: | |
| CCACHE_DIR: ${{ github.workspace }}/.ccache | |
| CCACHE_COMPILERCHECK: content | |
| CCACHE_COMPRESS: 1 | |
| CCACHE_COMPRESSLEVEL: 5 | |
| CCACHE_MAXSIZE: 2G | |
| steps: | |
| - name: Env | |
| run: echo "${HOME}/.local/bin" >> $GITHUB_PATH | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Cache ccache and conan | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ github.workspace }}/.ccache | |
| ~/.conan2 | |
| key: ubuntu-2204-st-cache-${{ github.sha }} | |
| restore-keys: ubuntu-2204-st-cache- | |
| - name: Prepare | |
| run: | | |
| sh scripts/install_deps.sh | |
| - name: Integration Testing | |
| run: | | |
| make st | |
| coverage-ubuntu: | |
| name: Test all with coverage | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 120 | |
| env: | |
| CCACHE_DIR: ${{ github.workspace }}/.ccache | |
| CCACHE_COMPILERCHECK: content | |
| CCACHE_COMPRESS: 1 | |
| CCACHE_COMPRESSLEVEL: 5 | |
| CCACHE_MAXSIZE: 2G | |
| steps: | |
| - name: Env | |
| run: echo "${HOME}/.local/bin" >> $GITHUB_PATH | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Cache ccache and conan | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ github.workspace }}/.ccache | |
| ~/.conan2 | |
| key: ubuntu-2204-coverage-cache-${{ github.sha }} | |
| restore-keys: ubuntu-2204-coverage-cache- | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.8' | |
| - name: Prepare | |
| run: | | |
| sh scripts/install_deps.sh | |
| - name: Testing With Coverage | |
| run: | | |
| make coverage | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./code_coverage/lcov_output.info | |
| name: ubuntu-22.04-coverage | |
| disable_safe_directory: true | |
| verbose: true | |
| macos: | |
| name: Build and test macOS ${{ matrix.macos }} (${{ matrix.build_mode }}) | |
| runs-on: macos-${{ matrix.macos }} | |
| timeout-minutes: 75 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - macos: 14 | |
| build_mode: no-conan | |
| - macos: 15 | |
| build_mode: conan | |
| env: | |
| CCACHE_DIR: ${{ github.workspace }}/.ccache | |
| CCACHE_COMPILERCHECK: content | |
| CCACHE_COMPRESS: 1 | |
| CCACHE_CPP2: true | |
| CCACHE_COMPRESSLEVEL: 5 | |
| CCACHE_MAXSIZE: 2G | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Cache ccache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ github.workspace }}/.ccache | |
| key: macos-${{ matrix.macos }}-ccache-${{ github.sha }} | |
| restore-keys: macos-${{ matrix.macos }}-ccache- | |
| - name: Prepare | |
| run: | | |
| mkdir ~/.venv | |
| python3 -m venv ~/.venv | |
| source ~/.venv/bin/activate | |
| sh scripts/install_deps.sh | |
| - name: Unit Testing (no-conan) | |
| if: ${{ matrix.build_mode == 'no-conan' }} | |
| run: | | |
| make test-no-conan | |
| - name: Unit Testing (conan) | |
| if: ${{ matrix.build_mode == 'conan' }} | |
| run: | | |
| source ~/.venv/bin/activate | |
| make test | |
| windows: | |
| name: Build and test windows | |
| runs-on: windows-2022 | |
| timeout-minutes: 75 | |
| env: | |
| CCACHE_DIR: ${{ github.workspace }}/.ccache | |
| CCACHE_COMPILERCHECK: content | |
| CCACHE_COMPRESS: 1 | |
| CCACHE_COMPRESSLEVEL: 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Cache ccache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ github.workspace }}/.ccache | |
| key: windows-ccache-${{ github.sha }} | |
| restore-keys: windows-ccache- | |
| - name: Install dependencies on windows | |
| shell: cmd | |
| run: | | |
| choco install cmake ninja ccache --no-progress | |
| cmake --version | |
| ninja --version | |
| where ccache >nul 2>&1 && (ccache --version) || (echo ccache not installed - build will proceed without caching) | |
| - name: Build | |
| shell: cmd | |
| run: | | |
| call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
| rem Enable ccache launcher only if ccache is available. Chocolatey | |
| rem sometimes fails to install it (503/504 outages); without this | |
| rem guard every compile would try to spawn a non-existent ccache.exe | |
| rem and the build would die with "CreateProcess failed". | |
| where ccache >nul 2>&1 && (set LAUNCHER=-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache) || (set LAUNCHER=) | |
| cmake -S . -B build -DMILVUS_BUILD_TEST=YES -G Ninja %LAUNCHER% | |
| cmake --build build | |
| - name: Unit Testing | |
| shell: cmd | |
| run: | | |
| build\test\testing-ut | |
| build\test\testing-it |