Added CMake preset build Windows-Msvc-Vs2022-Release #38
This file contains 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: ci | |
on: | |
workflow_dispatch: | |
pull_request: | |
release: | |
types: [published] | |
push: | |
branches: | |
- main | |
- dev | |
jobs: | |
build-test-windows: | |
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: windows-latest | |
configure-preset: "Windows-Msvc-Ninja-Debug" | |
build-preset: "Windows-Msvc-Ninja-Debug" | |
- os: windows-latest | |
configure-preset: "Windows-Msvc-Ninja-Release" | |
build-preset: "Windows-Msvc-Ninja-Release" | |
- os: windows-latest | |
configure-preset: "Windows-Msvc-NinjaMultiConfig" | |
build-preset: "Windows-Msvc-NinjaMultiConfig-Debug" | |
- os: windows-latest | |
configure-preset: "Windows-Msvc-Vs2022" | |
build-preset: "Windows-Msvc-Vs2022-Debug" | |
name: ${{matrix.build-preset}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Env variable | |
shell: bash | |
run: | | |
printenv | |
# echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV | |
- name: Set ownership | |
shell: bash | |
run: | | |
# this is to fix GIT not liking owner of the checkout dir | |
#chown -R $(id -u):$(id -g) $PWD | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: Vcpkg Cache | |
uses: ./.github/actions/vcpkg_cache | |
- name: CPM Cache | |
id: cache-cpm | |
uses: actions/cache@v4 | |
with: | |
path: _Out/cpm_sources | |
key: ${{ runner.os }}-cpm-${{ hashFiles('**/') }} | |
restore-keys: | | |
${{ runner.os }}-cpm- | |
# - name: Setup Cache | |
# uses: ./.github/actions/setup_cache | |
# with: | |
# compiler: ${{ matrix.compiler }} | |
# build_type: ${{ matrix.build_type }} | |
# packaging_maintainer_mode: false | |
# generator: ${{ matrix.generator }} | |
- name: "CMake Configure & Build" | |
run: | | |
& { . Scripts\Build\VsEnvironment.ps1; LaunchVsDevShell } | |
cmake --preset ${{matrix.configure-preset}} -DGIT_SHA:STRING=${{ github.sha }} | |
cmake --build --preset ${{matrix.build-preset}} | |
# - name: Tests | |
# run: | | |
# cmake --build --preset $CMAKE_PRESET | |
build-test-linux: | |
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | |
runs-on: ubuntu-latest | |
container: | |
image: ${{ matrix.os == 'ubuntu-latest' && 'ghcr.io/monamimani-builds/cpp-devcontainer:a524189b6082de6c08216ef1f3ea2544a9cdf5a4' || '' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
configure-preset: "Linux-Clang-Ninja-Debug" | |
build-preset: "Linux-Clang-Ninja-Debug" | |
- os: ubuntu-latest | |
configure-preset: "Linux-Clang-Ninja-Release" | |
build-preset: "Linux-Clang-Ninja-Release" | |
- os: ubuntu-latest | |
configure-preset: "Linux-Gcc-Ninja-Debug" | |
build-preset: "Linux-Gcc-Ninja-Debug" | |
- os: ubuntu-latest | |
configure-preset: "Linux-Gcc-Ninja-Release" | |
build-preset: "Linux-Gcc-Ninja-Release" | |
- os: ubuntu-latest | |
configure-preset: "Linux-Clang-NinjaMultiConfig-Debug" | |
build-preset: "Linux-Clang-NinjaMultiConfig-Debug" | |
name: ${{matrix.build-preset}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Env variable | |
shell: bash | |
run: | | |
printenv | |
# echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV | |
- name: Set ownership | |
shell: bash | |
run: | | |
# this is to fix GIT not liking owner of the checkout dir | |
#chown -R $(id -u):$(id -g) $PWD | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: Vcpkg Cache | |
uses: ./.github/actions/vcpkg_cache | |
- name: CPM Cache | |
id: cache-cpm | |
uses: actions/cache@v4 | |
with: | |
path: _Out/cpm_sources | |
key: ${{ runner.os }}-cpm-${{ hashFiles('**/') }} | |
restore-keys: | | |
${{ runner.os }}-cpm- | |
# - name: Setup Cache | |
# uses: ./.github/actions/setup_cache | |
# with: | |
# compiler: ${{ matrix.compiler }} | |
# build_type: ${{ matrix.build_type }} | |
# packaging_maintainer_mode: false | |
# generator: ${{ matrix.generator }} | |
- name: "[Linux] CMake Configure & Build" | |
if: runner.os == 'Linux' | |
continue-on-error: true | |
run: | | |
cmake --preset ${{matrix.configure-preset}} -DGIT_SHA:STRING=${{ github.sha }} -DPersonalWorks_ENABLE_CLANG_TIDY=OFF -DPersonalWorks_ENABLE_CPPCHECK=OFF | |
cmake --build --preset ${{matrix.build-preset}} | |
# - name: Tests | |
# run: | | |
# cmake --build --preset $CMAKE_PRESET |