From 9d23c0efe3ce45750890cbbafe07ec08669ae426 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 15 Jul 2023 09:58:04 +0300 Subject: [PATCH] add continuous integration via GitHub Actions * Windows 32- and 64-bit builds using Visual Studio solution * Linux builds using GCC and Clang * macOS x86_64 and arm64 builds using Xcode project --- .github/workflows/build-linux.yml | 21 +++++++++++++++++++++ .github/workflows/build-mac.yml | 25 +++++++++++++++++++++++++ .github/workflows/build-windows.yml | 24 ++++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 .github/workflows/build-linux.yml create mode 100644 .github/workflows/build-mac.yml create mode 100644 .github/workflows/build-windows.yml diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml new file mode 100644 index 000000000..8c1c77e80 --- /dev/null +++ b/.github/workflows/build-linux.yml @@ -0,0 +1,21 @@ +name: Linux CI + +on: [push, pull_request] + +jobs: + build-linux: + name: Build Linux + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + compiler: ["clang", "gcc"] + + steps: + - uses: actions/checkout@v3 + + - name: Install Dependencies + run: sudo apt update && sudo apt install libmad0-dev libsdl2-dev libvorbis-dev + + - name: Build ${{ matrix.compiler }} + run: make --jobs=3 --keep-going --directory=Quake CC=${{ matrix.compiler }} USE_SDL2=1 diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml new file mode 100644 index 000000000..639eaf7b6 --- /dev/null +++ b/.github/workflows/build-mac.yml @@ -0,0 +1,25 @@ +name: macOS CI + +on: [push, pull_request] + +jobs: + build-mac-os: + name: Build macOS + runs-on: macos-12 + strategy: + fail-fast: false + matrix: + architecture: [x64, M1] + + steps: + - uses: actions/checkout@v3 + + - name: Build ${{ matrix.architecture }} + shell: bash + run: | + set -o pipefail + xcodebuild \ + -project MacOSX/QuakeSpasm.xcodeproj \ + -configuration Release \ + -target QuakeSpasm-SDL2-${{ matrix.architecture }} \ + | xcpretty diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml new file mode 100644 index 000000000..9fd41e3c9 --- /dev/null +++ b/.github/workflows/build-windows.yml @@ -0,0 +1,24 @@ +name: Windows CI + +on: [push, pull_request] + +jobs: + build-windows: + name: Build Windows + runs-on: windows-2022 + strategy: + fail-fast: false + matrix: + platform: [x64, Win32] + + steps: + - uses: actions/checkout@v3 + + - name: Build ${{ matrix.platform }} + run: | + $vsroot = (Get-VisualStudioInstance).InstallationPath + $devenv = join-path $vsroot "Common7\IDE\devenv.com" + $solution = "Windows/VisualStudio/quakespasm.sln" + & $devenv $solution /Upgrade + & $devenv $solution /Build "Release|${{ matrix.platform }}" + if (-not $?) { throw "Build failed" }