This repository has been archived by the owner on Jul 17, 2024. It is now read-only.
test: github workflows 2 #12
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
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. | |
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml | |
name: CMake on multiple platforms | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# os: [ubuntu-latest, windows-latest] | |
os: [ubuntu-latest] | |
build_type: [Release] | |
c_compiler: [gcc, cl] | |
include: | |
# - os: windows-latest | |
# c_compiler: cl | |
# cpp_compiler: cl | |
# triplets: x64-windows | |
- os: ubuntu-latest | |
c_compiler: gcc | |
cpp_compiler: g++ | |
triplets: x64-linux | |
exclude: | |
- os: windows-latest | |
c_compiler: gcc | |
- os: windows-latest | |
c_compiler: clang | |
- os: ubuntu-latest | |
c_compiler: cl | |
env: | |
VULKAN_SDK: "" | |
VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set reusable strings | |
id: strings | |
shell: bash | |
run: | | |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | |
# configure vcpkg and set vcpkg dir to VCPKG_ROOT | |
# - name: Setup vcpkg | |
# run: | | |
# git clone https://github.com/Microsoft/vcpkg.git ${{ github.workspace }}/vcpkg | |
# cd ${{ github.workspace }}/vcpkg | |
# ./bootstrap-vcpkg.sh | |
- name: Preparing vcpkg | |
uses: actions/checkout@v2 | |
with: | |
repository: microsoft/vcpkg | |
path: ${{ github.workspace }}/vcpkg | |
ref: 8b04a7bd93bef991818fc372bb83ce00ec1c1c16 | |
- name: Configure vcpkg | |
run: | | |
cd ${{ github.workspace }}/vcpkg | |
./bootstrap-vcpkg.sh | |
# install vulkan sdk whatever on windows or linux | |
# - name: Install Vulkan SDK - If Windows | |
# if: matrix.triplets == 'x64-windows' | |
# run: | | |
# choco install vulkan-sdk | |
# setup VULKAN_SDK env var for windows | |
# - name: Set VULKAN_SDK - If Windows | |
# if: matrix.triplets == 'x64-windows' | |
# run: echo "::set-env name=VULKAN_SDK::C:/Program Files/LunarG/VulkanSDK/" | |
# add libsdl2 libsdl2-image | |
- name: Install Vulkan SDK - If Linux | |
if: matrix.triplets == 'x64-linux' | |
run: | | |
sudo apt-get install libsdl2-dev libsdl2-image-dev libvulkan-dev | |
- name: Configure CMake | |
run: > | |
cmake -B ${{ steps.strings.outputs.build-output-dir }} \ | |
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \ | |
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake \ | |
-S ${{ github.workspace }} \ | |
- name: Build | |
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} |