Descent3/.github/workflows/build.yml

90 lines
2.5 KiB
YAML
Raw Normal View History

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'
- '**/.github/**'
2024-04-16 18:09:30 +00:00
jobs:
build:
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
preset: win
cc: cl
cxx: cl
name: Windows-x86
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++
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++
name: macOS-ARM
2024-04-21 17:11:48 +00:00
- runner: ubuntu-latest
preset: linux
cc: gcc
cxx: g++
name: Linux-x64
2024-04-21 17:11:48 +00:00
- runner: ubuntu-latest
preset: linux
cc: clang
cxx: clang++
name: Linux-x64-clang
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:
- uses: actions/checkout@v4
2024-04-16 18:09:30 +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
- name: Install Linux dependencies
if: ${{ matrix.os.preset == 'linux' }}
run: |
sudo apt update
sudo apt install -y --no-install-recommends \
ninja-build cmake g++ libgtest-dev libsdl1.2-dev libsdl-image1.2-dev libncurses-dev zlib1g-dev
- 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
run: cmake --preset ${{ matrix.os.preset }} -DBUILD_TESTING=ON
2024-04-16 18:09:30 +00:00
- name: Build ${{ matrix.build_type }}
run: cmake --build --preset ${{ matrix.os.preset }} --config ${{ matrix.build_type }} --verbose
- name: Run ${{ matrix.build_type }} Unittests
run: ctest --preset ${{ matrix.os.preset }} -C ${{ matrix.build_type }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Descent3_${{ matrix.build_type }}_${{ matrix.os.name }}
path: ${{ github.workspace }}/builds/${{ matrix.os.preset }}/Descent3/${{ matrix.build_type }}/