Skip to content

Merge pull request #507 from fabiangreffrath/raven_center_message #3507

Merge pull request #507 from fabiangreffrath/raven_center_message

Merge pull request #507 from fabiangreffrath/raven_center_message #3507

name: Continuous Integration
on: [push, pull_request]
env:
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite"
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
defaults:
run:
shell: ${{ matrix.config.shell }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "MSVC x64",
os: windows-latest,
build_type: "Release",
extra_options: "-A x64",
package_name: "vs_x64",
vcpkg_triplet: x64-windows,
shell: bash,
}
- {
name: "MSYS2 UCRT64",
os: windows-latest,
build_type: "Release",
extra_options: "-G Ninja",
package_name: "mingw_x64",
shell: "msys2 {0}",
msystem: ucrt64,
msys-env: mingw-w64-ucrt-x86_64,
}
- {
name: "Linux GCC",
os: ubuntu-latest,
build_type: "Release",
extra_options: "-G Ninja",
package_name: "linux_gcc",
shell: bash,
}
- {
name: "macOS Clang",
os: macos-latest,
build_type: "Release",
extra_options: "-G Ninja",
package_name: "macos",
shell: bash,
}
steps:
- uses: actions/checkout@v4
- name: Install Dependencies (MSYS2)
if: matrix.config.shell == 'msys2 {0}'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.config.msystem }}
install: >-
${{ matrix.config.msys-env }}-gcc
${{ matrix.config.msys-env }}-cmake
${{ matrix.config.msys-env }}-ninja
${{ matrix.config.msys-env }}-pkgconf
${{ matrix.config.msys-env }}-dumb
${{ matrix.config.msys-env }}-fluidsynth
${{ matrix.config.msys-env }}-libmad
${{ matrix.config.msys-env }}-libvorbis
${{ matrix.config.msys-env }}-portmidi
${{ matrix.config.msys-env }}-SDL2
${{ matrix.config.msys-env }}-SDL2_image
${{ matrix.config.msys-env }}-SDL2_mixer
${{ matrix.config.msys-env }}-libzip
- name: Setup vcpkg (MSVC)
if: ${{ matrix.config.vcpkg_triplet }}
run: |
set -euo pipefail
NUGET=$(vcpkg fetch nuget | tail -n 1)
GH_PACKAGES_URL="https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
cd "$VCPKG_INSTALLATION_ROOT"
git fetch --tags
LATESTTAG=$(git describe --tags --abbrev=0)
git checkout $LATESTTAG
"$NUGET" sources add \
-source "$GH_PACKAGES_URL" \
-storepasswordincleartext \
-name "GitHub" \
-username "${{ github.repository_owner }}" \
-password "${{ secrets.GITHUB_TOKEN }}"
"$NUGET" setapikey "${{ secrets.GITHUB_TOKEN }}" \
-source "$GH_PACKAGES_URL"
echo "CMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" >> $GITHUB_ENV
echo "VCPKG_TARGET_TRIPLET=${{ matrix.config.vcpkg_triplet }}" >> $GITHUB_ENV
- name: Install Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y \
gcc \
cmake \
ninja-build \
pkg-config \
libdumb1-dev \
libfluidsynth-dev \
libmad0-dev \
libportmidi-dev \
libsdl2-dev \
libsdl2-image-dev \
libsdl2-mixer-dev \
libvorbis-dev \
libzip-dev \
zipcmp \
zipmerge \
ziptool
- name: Install Dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew update
env HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 \
brew install \
cmake \
ninja \
pkg-config \
dumb \
fluid-synth \
libvorbis \
libzip \
mad \
portmidi \
sdl2 \
sdl2_image \
sdl2_mixer
- name: Configure
run: |
cmake -S prboom2 \
-B build \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
${{ matrix.config.extra_options }}
- name: Build
run: cmake --build build --config ${{ matrix.config.build_type }}