2024-04-16 18:09:30 +00:00
|
|
|
name: Descent 3 Build
|
|
|
|
|
|
|
|
on:
|
2024-04-24 19:57:52 +00:00
|
|
|
workflow_dispatch:
|
2024-04-16 18:09:30 +00:00
|
|
|
push:
|
2024-04-17 22:44:21 +00:00
|
|
|
branches: [ "main" ]
|
2024-04-22 21:31:41 +00:00
|
|
|
paths-ignore:
|
|
|
|
- '**/README.md'
|
|
|
|
- '**/LICENSE'
|
|
|
|
- '**/.github/**'
|
2024-04-16 18:09:30 +00:00
|
|
|
pull_request:
|
|
|
|
branches: [ "main" ]
|
2024-04-22 21:31:41 +00:00
|
|
|
paths-ignore:
|
|
|
|
- '**/README.md'
|
|
|
|
- '**/LICENSE'
|
2024-04-16 18:09:30 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2024-04-25 19:43:52 +00:00
|
|
|
name: ${{ matrix.os.runner }}, ${{ matrix.os.cxx }}, ${{ matrix.build_type }}
|
2024-04-16 18:09:30 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-04-17 18:46:40 +00:00
|
|
|
os:
|
2024-04-21 17:11:48 +00:00
|
|
|
- runner: windows-latest
|
2024-05-22 12:20:14 +00:00
|
|
|
preset: win32
|
2024-04-21 17:11:48 +00:00
|
|
|
cc: cl
|
|
|
|
cxx: cl
|
2024-04-25 20:47:41 +00:00
|
|
|
name: Windows-x86
|
2024-05-22 12:20:14 +00:00
|
|
|
- runner: windows-latest
|
|
|
|
preset: win64
|
|
|
|
cc: cl
|
|
|
|
cxx: cl
|
|
|
|
name: Windows-x64
|
2024-04-21 17:11:48 +00:00
|
|
|
- runner: macos-12 # This is supposed to be Intel for now, and what macos-latest is defaulting to for some reason (as of 04/2024)
|
|
|
|
preset: mac
|
|
|
|
cc: cc
|
|
|
|
cxx: c++
|
2024-04-25 20:47:41 +00:00
|
|
|
name: macOS-Intel
|
2024-04-21 17:11:48 +00:00
|
|
|
- runner: macos-14 # This is supposed to be M1
|
|
|
|
preset: mac
|
|
|
|
cc: cc
|
|
|
|
cxx: c++
|
2024-04-25 20:47:41 +00:00
|
|
|
name: macOS-ARM
|
2024-04-21 17:11:48 +00:00
|
|
|
- runner: ubuntu-latest
|
|
|
|
preset: linux
|
|
|
|
cc: gcc
|
|
|
|
cxx: g++
|
2024-04-25 20:47:41 +00:00
|
|
|
name: Linux-x64
|
2024-04-21 17:11:48 +00:00
|
|
|
- runner: ubuntu-latest
|
|
|
|
preset: linux
|
|
|
|
cc: clang
|
|
|
|
cxx: clang++
|
2024-04-25 20:47:41 +00:00
|
|
|
name: Linux-x64-clang
|
2024-04-25 19:23:22 +00:00
|
|
|
build_type:
|
|
|
|
- Debug
|
|
|
|
- Release
|
2024-04-16 18:09:30 +00:00
|
|
|
|
2024-04-17 02:08:32 +00:00
|
|
|
runs-on: ${{ matrix.os.runner }}
|
2024-04-16 18:09:30 +00:00
|
|
|
|
|
|
|
steps:
|
2024-04-17 22:48:51 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-04-16 18:09:30 +00:00
|
|
|
|
2024-04-17 22:48:51 +00:00
|
|
|
- name: Install macOS dependencies
|
|
|
|
if: ${{ matrix.os.preset == 'mac' }}
|
|
|
|
run: |
|
|
|
|
# Install packages from Homebrew
|
|
|
|
brew bundle install
|
2024-04-17 02:12:59 +00:00
|
|
|
|
2024-04-17 23:00:35 +00:00
|
|
|
- name: Install Linux dependencies
|
|
|
|
if: ${{ matrix.os.preset == 'linux' }}
|
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install -y --no-install-recommends \
|
2024-04-30 16:36:52 +00:00
|
|
|
ninja-build cmake g++ libgtest-dev libsdl2-dev libncurses-dev zlib1g-dev libspdlog-dev
|
2024-04-17 23:00:35 +00:00
|
|
|
|
2024-04-17 22:48:51 +00:00
|
|
|
- name: Configure CMake
|
2024-04-21 17:11:48 +00:00
|
|
|
env:
|
|
|
|
CC: ${{ matrix.os.cc }}
|
|
|
|
CXX: ${{ matrix.os.cxx }}
|
2024-04-21 18:49:16 +00:00
|
|
|
VCPKG_ROOT: C:/vcpkg
|
2024-05-08 20:27:25 +00:00
|
|
|
run: cmake --preset ${{ matrix.os.preset }} -DBUILD_TESTING=ON -DENABLE_LOGGER=ON -DFORCE_PORTABLE_INSTALL=ON
|
2024-04-16 18:09:30 +00:00
|
|
|
|
2024-04-25 19:23:22 +00:00
|
|
|
- name: Build ${{ matrix.build_type }}
|
|
|
|
run: cmake --build --preset ${{ matrix.os.preset }} --config ${{ matrix.build_type }} --verbose
|
2024-04-21 03:10:06 +00:00
|
|
|
|
2024-04-25 19:23:22 +00:00
|
|
|
- name: Run ${{ matrix.build_type }} Unittests
|
|
|
|
run: ctest --preset ${{ matrix.os.preset }} -C ${{ matrix.build_type }}
|
2024-04-24 12:14:59 +00:00
|
|
|
|
2024-05-08 20:27:25 +00:00
|
|
|
- name: Local install
|
|
|
|
# There no cmake install presets so install in traditional way
|
|
|
|
run: cmake --install builds/${{ matrix.os.preset }}/ --config ${{ matrix.build_type }}
|
|
|
|
|
2024-04-17 22:48:51 +00:00
|
|
|
- name: Upload Artifacts
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
2024-04-25 19:23:22 +00:00
|
|
|
name: Descent3_${{ matrix.build_type }}_${{ matrix.os.name }}
|
2024-05-08 20:27:25 +00:00
|
|
|
path: ${{ github.workspace }}/builds/${{ matrix.os.preset }}/installed/
|