[依赖和工作流更新]: 升级GitHub Actions和vcpkg依赖管理 #158
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: CMake Build | |
| on: | |
| push: | |
| paths-ignore: | |
| - '.clang*' | |
| - '.gitignore' | |
| - 'LICENSE' | |
| - 'README*' | |
| pull_request: | |
| paths-ignore: | |
| - '.clang*' | |
| - '.gitignore' | |
| - 'LICENSE' | |
| - 'README*' | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - windows-latest | |
| - macos-latest | |
| - ubuntu-latest | |
| build_type: | |
| - "Debug" | |
| - "Release" | |
| - "MinSizeRel" | |
| - "RelWithDebInfo" | |
| generators: | |
| - "Ninja" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 1 | |
| - uses: ./.github/actions/install-dependencies | |
| - name: Configure and build windows | |
| if: startsWith(matrix.os, 'windows') | |
| shell: pwsh | |
| run: | | |
| .\scripts\windows\setVsDev.ps1 | |
| cmake ` | |
| -S . ` | |
| -B ./build ` | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ` | |
| -G "${{ matrix.generators }}" ` | |
| ; if (-not $?) { Get-Content ./build/vcpkg_installed/vcpkg/issue_body.md; exit 1 } | |
| cmake --build ./build --config ${{ matrix.build_type }} | |
| - name: Configure and build macos or ubuntu | |
| if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') | |
| shell: bash | |
| run: | | |
| cmake \ | |
| -S . \ | |
| -B ./build \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
| -G "${{ matrix.generators }}" \ | |
| || (cat ./build/vcpkg_installed/vcpkg/issue_body.md && exit 1) | |
| cmake --build ./build --config ${{ matrix.build_type }} | |
| - name: Test | |
| shell: bash | |
| run: cd build && ctest -C ${{ matrix.build_type }} --output-on-failure | |