Skip to content

Starts with greeting #30

Starts with greeting

Starts with greeting #30

name: CMake on multiple platforms
on:
push:
branches:
- master
- main
- dev
pull_request:
branches:
- master
- main
- dev
jobs:
Windows-Job:
runs-on: [self-hosted, Windows, x64]
strategy:
fail-fast: true
matrix:
compiler:
- msvc
- clang
build_type:
- debug
- dev
- release
steps:
- name: Greeting
run: |
echo "[cmake-multi-platform][TRACE] Hello World"
echo "[cmake-multi-platform][TRACE] github.workspace: ${{ github.workspace }}"
- name: Cloning
uses: actions/checkout@v4
with:
submodules: recursive
- name: Checking ccache
shell: cmd
run: echo "%PATH%"
- name: Bootstrapping vcpkg
run: |
${{ github.workspace }}/tools/BuildTools/vcpkg/bootstrap-vcpkg.sh
- name: Configuring
run: |
echo "[cmake-multi-platform][TRACE] Configuring"
cmd "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsall.bat"
cmake -S ${{ github.workspace }} --preset windows-${{matrix.compiler}}-${{matrix.build_type}}
- name: Building
run: |
echo "[cmake-multi-platform][TRACE] Building"
cmake --build ${{ github.workspace }}/out/build/windows-${{matrix.compiler}}-${{matrix.build_type}}
- name: Testing
run: |
echo "[cmake-multi-platform][TRACE] Testing"
ctest --test-dir ${{ github.workspace }}/out/build/windows-${{matrix.compiler}}-${{matrix.build_type}}
- name: Installing
run: echo "[cmake-multi-platform][TRACE] Installing"
- name: Packaging
run: echo "[cmake-multi-platform][TRACE] Packaging"
# env:
# CLANG_TIDY_VERSION: "15.0.2"
# jobs:
# Test:
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os:
# - windows-latest
# - ubuntu-latest
# compiler:
# - llvm-15.0.2
# - gcc
# generator:
# - "Ninja Multi-Config"
# build_type:
# - Release
# - Debug
# include:
# - os: "windows-latest"
# compiler: "msvc"
# steps:
# - name: Check for LLVM version mismatches
# if: ${{ contains(matrix.compiler, 'llvm') && !contains(matrix.compiler, env.CLANG_TIDY_VERSION) }}
# uses: actions/github-script@v3
# with:
# script: |
# core.setFailed('There is a mismatch between configured llvm compiler and clang-tidy version chosen')
# - uses: actions/checkout@v4
# with:
# submodules: recursive
# - name: Cache
# uses: actions/cache@v3
# with:
# path: |
# ~/vcpkg
# ./build/vcpkg_installed
# ${{ env.HOME }}/.cache/vcpkg/archives
# ${{ env.XDG_CACHE_HOME }}/vcpkg/archives
# ${{ env.LOCALAPPDATA }}\vcpkg\archives
# ${{ env.APPDATA }}\vcpkg\archives
# key: ${{ runner.os }}-${{ matrix.compiler }}-${{ env.BUILD_TYPE }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('./vcpkg.json')}}
# restore-keys: |
# ${{ runner.os }}-${{ env.BUILD_TYPE }}-
# - name: Setup Cpp
# uses: aminya/setup-cpp@v1
# with:
# compiler: ${{ matrix.compiler }}
# vcvarsall: ${{ contains(matrix.os, 'windows') }}
# cmake: true
# ninja: true
# vcpkg: true
# clangtidy: ${{ env.CLANG_TIDY_VERSION }}
# cppcheck: true
# - id: getOS
# if: ${{ contains(matrix.os, 'ubuntu') }}
# run: |
# INPUT="${{matrix.os}}"
# OUTPUT="linux"
# echo "::set-output name=convertedString::${OUTPUT}
# - id: getOS
# if: ${{ !contains(matrix.os, 'ubuntu') }}
# run: |
# INPUT="${{matrix.os}}"
# OUTPUT="${INPUT%-*}"
# echo "::set-output name=convertedString::${OUTPUT}
# - id: getCompiler
# run: |
# INPUT="${{matrix.os}}"
# OUTPUT="${INPUT%-*}"
# echo "::set-output name=convertedString::${OUTPUT}
# - id: getBuildType
# run: |
# INPUT="{{matrix.build_type}}"
# echo "::set-output name=lowerCaseValue::${INPUT,,}"
# - name: Configure CMake
# run: |
# cmake -S . --preset ${{matrix.os}}-${{matrix.compiler}}-${{matrix.build_type}}
# - name: Build
# run: |
# cmake --build ${{matrix.os}}-${{matrix.compiler}}-${{matrix.build_type}}
# - name: Test
# working-directory: ./out/build/${{matrix.os}}-${{matrix.compiler}}-${{matrix.build_type}}
# run: |
# ctest