Skip to content

Fixing build in GitHub Actions. #317

Fixing build in GitHub Actions.

Fixing build in GitHub Actions. #317

Workflow file for this run

name: Build
on:
push:
branches:
- master
workflow_dispatch:
inputs:
name:
description: 'Reason for triggering a build.'
required: true
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ${{ matrix.os }}
defaults:
run:
shell: ${{ matrix.shell }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
name: ubuntu
generator: "Ninja"
shell: bash
dependencies: gobjc gobjc++ gnustep gnustep-devel ninja-build x11-utils libx11-dev libx11-xcb-dev libxext-dev libxcb1-dev libxcb-image0-dev libxcb-shm0-dev subversion libassimp-dev libfreeimage-dev libfreetype6-dev libglm-dev libenet-dev
cmakeopts: -DLIGHTSKY_ENABLE_PCH:BOOL=ON
- os: macos-latest
name: macos
generator: "Ninja"
shell: bash
dependencies: ninja assimp freeimage libxkbcommon subversion freetype enet glm
cmakeopts: -DLIGHTSKY_ENABLE_PCH:BOOL=OFF
- os: windows-latest
name: mingw
generator: "Ninja"
shell: msys2 {0}
dependencies: cmake:u ninja:u toolchain:u freeimage:u
cmakeopts: -DLIGHTSKY_ENABLE_PCH:BOOL=ON
- os: windows-latest
name: msvc
generator: "Visual Studio 17 2022"
shell: pwsh
dependencies: tortoisesvn
cmakeopts: -DLIGHTSKY_ENABLE_PCH:BOOL=ON -DBUILD_FREETYPE:BOOL=ON
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache Build
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/${{ matrix.name }}-build
key: ${{ matrix.os }}-${{ matrix.name }}
restore-keys: ${{ matrix.os }}-${{ matrix.name }}
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install ${{ matrix.dependencies }}
- name: Install MacOS dependencies
if: matrix.os == 'macos-latest'
run: brew install ${{ matrix.dependencies }}
- name: Install Msys2 Dependencies
if: matrix.os == 'windows-latest' && matrix.shell != 'pwsh'
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
release: true
install: base-devel git subversion
pacboy: ${{ matrix.dependencies }}
- name: Install Windows dependencies
if: matrix.os == 'windows-latest' && matrix.shell == 'pwsh'
run: choco install ${{ matrix.dependencies }}
- name: Configure CMake
run: cmake -B "${{ github.workspace }}/${{ matrix.name }}-build" -G"${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ${{ matrix.cmakeopts }}
- name: Build
run: cmake --build "${{ github.workspace }}/${{ matrix.name }}-build" --config ${{ env.BUILD_TYPE }} --parallel