2020-04-11 17:37:12 +00:00
|
|
|
name: Continuous Integration
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2020-04-12 08:51:23 +00:00
|
|
|
name: ${{ matrix.config.name }} | ${{ matrix.config.build_type }}
|
2020-04-11 17:37:12 +00:00
|
|
|
runs-on: ${{ matrix.config.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
config:
|
2023-09-20 07:26:06 +00:00
|
|
|
- name: Visual Studio 2022
|
|
|
|
os: windows-2022
|
|
|
|
extra_options: -DCMAKE_TOOLCHAIN_FILE=build/vcpkg/scripts/buildsystems/vcpkg.cmake
|
|
|
|
build_type: Release
|
|
|
|
|
|
|
|
- name: Visual Studio 2022
|
|
|
|
os: windows-2022
|
|
|
|
extra_options: -DCMAKE_TOOLCHAIN_FILE=build/vcpkg/scripts/buildsystems/vcpkg.cmake
|
|
|
|
build_type: Debug
|
|
|
|
|
|
|
|
- name: Visual Studio 2019
|
|
|
|
os: windows-2019
|
|
|
|
extra_options: -DCMAKE_TOOLCHAIN_FILE=build/vcpkg/scripts/buildsystems/vcpkg.cmake
|
|
|
|
build_type: Release
|
|
|
|
|
|
|
|
- name: macOS
|
|
|
|
os: macos-12
|
|
|
|
deps_cmdline: brew install libvpx webp
|
|
|
|
build_type: Release
|
|
|
|
|
|
|
|
- name: macOS
|
|
|
|
os: macos-12
|
|
|
|
extra_options: -G Xcode -DDYN_OPENAL=OFF
|
|
|
|
deps_cmdline: brew install libvpx webp
|
|
|
|
build_type: Debug
|
|
|
|
|
|
|
|
- name: Linux GCC 9
|
|
|
|
os: ubuntu-22.04
|
|
|
|
extra_options: -DCMAKE_C_COMPILER=gcc-9 -DCMAKE_CXX_COMPILER=g++-9
|
|
|
|
deps_cmdline: sudo apt update && sudo apt install libsdl2-dev libvpx-dev libgtk2.0-dev libwebp-dev
|
|
|
|
build_type: RelWithDebInfo
|
|
|
|
|
|
|
|
- name: Linux GCC 12
|
|
|
|
os: ubuntu-22.04
|
|
|
|
extra_options: -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12
|
|
|
|
deps_cmdline: sudo apt update && sudo apt install libsdl2-dev libvpx-dev libgtk-3-dev libwebp-dev
|
|
|
|
build_type: MinSizeRel
|
|
|
|
|
|
|
|
- name: Linux Clang 11
|
|
|
|
os: ubuntu-22.04
|
|
|
|
extra_options: -DCMAKE_C_COMPILER=clang-11 -DCMAKE_CXX_COMPILER=clang++-11 -DDYN_OPENAL=OFF
|
|
|
|
deps_cmdline: sudo apt update && sudo apt install clang-11 libsdl2-dev libvpx-dev libopenal-dev libwebp-dev
|
|
|
|
build_type: Debug
|
|
|
|
|
|
|
|
- name: Linux Clang 15
|
|
|
|
os: ubuntu-22.04
|
|
|
|
extra_options: -DCMAKE_C_COMPILER=clang-15 -DCMAKE_CXX_COMPILER=clang++-15
|
|
|
|
deps_cmdline: sudo apt update && sudo apt install clang-15 libsdl2-dev libvpx-dev libwebp-dev
|
|
|
|
build_type: Release
|
2020-04-11 17:37:12 +00:00
|
|
|
|
|
|
|
steps:
|
2023-09-20 07:26:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-04-11 17:37:12 +00:00
|
|
|
|
|
|
|
- name: Install Dependencies
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2023-09-20 07:26:06 +00:00
|
|
|
if [[ -n "${{ matrix.config.deps_cmdline }}" ]]; then
|
2020-04-11 17:37:12 +00:00
|
|
|
eval ${{ matrix.config.deps_cmdline }}
|
|
|
|
fi
|
|
|
|
mkdir build
|
2021-05-22 10:08:55 +00:00
|
|
|
if [[ "${{ runner.os }}" == 'macOS' ]]; then
|
2022-06-18 10:14:27 +00:00
|
|
|
export ZMUSIC_PACKAGE=zmusic-1.1.9-macos.tar.xz
|
2021-05-22 10:08:55 +00:00
|
|
|
elif [[ "${{ runner.os }}" == 'Linux' ]]; then
|
2022-06-18 10:14:27 +00:00
|
|
|
export ZMUSIC_PACKAGE=zmusic-1.1.9-linux.tar.xz
|
2021-05-22 10:08:55 +00:00
|
|
|
fi
|
2023-09-20 07:26:06 +00:00
|
|
|
if [[ -n "${ZMUSIC_PACKAGE}" ]]; then
|
2021-05-22 10:08:55 +00:00
|
|
|
cd build
|
|
|
|
wget -q "https://github.com/coelckers/gzdoom/releases/download/ci_deps/${ZMUSIC_PACKAGE}"
|
|
|
|
tar -xf "${ZMUSIC_PACKAGE}"
|
|
|
|
fi
|
2023-08-21 18:50:36 +00:00
|
|
|
|
|
|
|
- name: Setup vcpkg
|
|
|
|
uses: lukka/run-vcpkg@v11
|
|
|
|
if: runner.os == 'Windows'
|
|
|
|
with:
|
|
|
|
vcpkgDirectory: '${{ github.workspace }}/build/vcpkg'
|
2023-09-14 12:45:39 +00:00
|
|
|
vcpkgGitCommitId: '2c401863dd54a640aeb26ed736c55489c079323b'
|
2020-04-11 17:37:12 +00:00
|
|
|
|
|
|
|
- name: Configure
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2021-05-22 10:10:41 +00:00
|
|
|
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_PREFIX_PATH=`pwd`/build/zmusic -DPK3_QUIET_ZIPDIR=ON ${{ matrix.config.extra_options }} .
|
2020-04-11 17:37:12 +00:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2020-04-12 08:51:23 +00:00
|
|
|
export MAKEFLAGS=--keep-going
|
2020-04-11 17:37:12 +00:00
|
|
|
cmake --build build --config ${{ matrix.config.build_type }} --parallel 3
|
|
|
|
|
|
|
|
- name: Create Package
|
2020-04-12 08:51:23 +00:00
|
|
|
if: runner.os == 'Windows' # Remove to make packages of all targets
|
2020-04-11 17:37:12 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
cd build
|
|
|
|
mkdir package
|
|
|
|
if [[ "${{ runner.os }}" == 'Windows' ]]; then
|
|
|
|
cp ${{ matrix.config.build_type }}/gzdoom.exe ${{ matrix.config.build_type }}/*.pk3 package
|
|
|
|
elif [[ "${{ runner.os }}" == 'macOS' ]]; then
|
|
|
|
cp -r gzdoom.app package
|
|
|
|
elif [[ "${{ runner.os }}" == 'Linux' ]]; then
|
|
|
|
cp gzdoom *.pk3 package
|
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Upload Package
|
2020-04-12 08:51:23 +00:00
|
|
|
if: runner.os == 'Windows' # Remove to store packages of all targets
|
2023-09-20 07:26:06 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-04-11 17:37:12 +00:00
|
|
|
with:
|
|
|
|
path: build/package
|
2020-04-12 08:51:23 +00:00
|
|
|
name: ${{ matrix.config.name }} ${{ matrix.config.build_type }}
|
2020-04-11 17:37:12 +00:00
|
|
|
|
|
|
|
- name: List Build Directory
|
|
|
|
if: always()
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
git status
|
|
|
|
ls -lR build
|