Setup CI (14) #20
Workflow file for this run
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: Main | |
| on: | |
| push: | |
| branches: [ "ci" ] | |
| pull_request: | |
| branches: [ "ci" ] | |
| # https://devblogs.microsoft.com/cppblog/vcpkg-integration-with-the-github-dependency-graph/ | |
| permissions: | |
| contents: write | |
| env: | |
| # https://devblogs.microsoft.com/cppblog/vcpkg-integration-with-the-github-dependency-graph/ | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| VCPKG_ROOT: "C:/vcpkg" | |
| VCPKG_DEFAULT_BINARY_CACHE: "C:/vcpkg-binary-cache" | |
| VCPKG_FEATURE_FLAGS: dependencygraph | |
| jobs: | |
| build: | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get project vcpkg baseline | |
| shell: pwsh | |
| run: | | |
| $baseline = (Get-Content -Path vcpkg.json | ConvertFrom-Json).'builtin-baseline' | |
| echo "VCPKG_BASELINE=$baseline" >> $env:GITHUB_ENV | |
| - name: Cache vcpkg | |
| uses: actions/cache@v4 | |
| with: | |
| key: vcpkg-${{env.VCPKG_BASELINE}} | |
| path: | | |
| ${{env.VCPKG_DEFAULT_BINARY_CACHE}} | |
| - name: Setup vcpkg | |
| run: | | |
| git -C ${{env.VCPKG_ROOT}} pull origin ${{env.VCPKG_BASELINE}} | |
| ${{env.VCPKG_ROOT}}/bootstrap-vcpkg.bat | |
| New-Item -ItemType Directory -Path ${{env.VCPKG_DEFAULT_BINARY_CACHE}} -Force | |
| - name: Configure CMake | |
| run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=RelWithDebInfo --toolchain ${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake | |
| - name: Build | |
| run: cmake --build ${{github.workspace}}/build --config RelWithDebInfo | |
| # - name: Pack | |
| # run: | | |
| # cd ${{github.workspace}}/build/release | |
| # cpack --config CPackConfig.cmake | |
| # - name: Release nightly build | |
| # uses: andelf/nightly-release@main | |
| # with: | |
| # tag_name: nightly | |
| # name: 'Nightly Release $$' | |
| # files: | | |
| # ./build/debug/*.zip | |
| # ./build/release/*.zip |