Descent3/.github/workflows/build.yml

83 lines
2.3 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:
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
- 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++
- runner: macos-14 # This is supposed to be M1
preset: mac
cc: cc
cxx: c++
- runner: ubuntu-latest
preset: linux
cc: gcc
cxx: g++
- runner: ubuntu-latest
preset: linux
cc: clang
cxx: clang++
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 \
2024-04-21 18:49:16 +00:00
ninja-build cmake g++ 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 }}
2024-04-16 18:09:30 +00:00
- name: Debug Build
run: cmake --build --preset ${{ matrix.os.preset }} --config Debug --verbose
- name: Release Build
run: cmake --build --preset ${{ matrix.os.preset }} --config Release --verbose
2024-04-16 18:09:30 +00:00
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
2024-04-21 17:11:48 +00:00
name: build_${{ matrix.os.runner }}_${{ matrix.os.cxx }}
path: |
${{ github.workspace }}/builds/${{ matrix.os.preset }}/Descent3/Debug/
${{ github.workspace }}/builds/${{ matrix.os.preset }}/Descent3/Release/