276 lines
6.0 KiB
YAML
Raw Normal View History

2022-05-19 11:51:26 +03:00
name: Build
on:
2022-07-05 15:45:36 +03:00
push:
2022-07-31 23:05:30 +03:00
branches:
2022-07-31 23:06:27 +03:00
- main
2022-07-05 15:45:36 +03:00
pull_request:
2022-07-31 23:05:30 +03:00
types:
- opened
- synchronize
2022-05-19 11:51:26 +03:00
defaults:
2022-07-05 15:45:36 +03:00
run:
shell: bash
2022-05-19 11:51:26 +03:00
jobs:
2022-07-06 00:09:22 +03:00
static-analysis:
name: Static analysis
2022-05-19 11:51:26 +03:00
2022-07-05 15:45:36 +03:00
runs-on: ubuntu-latest
2022-05-19 11:51:26 +03:00
2022-07-06 00:09:22 +03:00
steps:
2022-07-05 15:45:36 +03:00
- name: Install
2022-07-06 00:09:22 +03:00
run: |
sudo apt update
2022-06-08 21:36:39 +02:00
sudo apt install cppcheck
2022-05-19 11:51:26 +03:00
2022-07-05 15:45:36 +03:00
- name: Clone
2024-03-03 11:27:37 +03:00
uses: actions/checkout@v4
2022-07-05 15:45:36 +03:00
- name: cppcheck
2022-07-06 00:09:22 +03:00
run: cppcheck --std=c++17 src/
2023-04-26 15:35:02 +03:00
code-format:
name: Code format check
runs-on: ubuntu-latest
steps:
- name: Clone
2024-03-03 11:27:37 +03:00
uses: actions/checkout@v4
2023-04-26 15:35:02 +03:00
- name: clang-format
run: find src -type f -name \*.cc -o -name \*.h | xargs clang-format --dry-run --Werror
2023-04-26 15:35:02 +03:00
2022-07-29 20:04:37 +03:00
android:
name: Android
runs-on: ubuntu-latest
steps:
- name: Clone
2024-03-03 11:27:37 +03:00
uses: actions/checkout@v4
2022-07-29 20:04:37 +03:00
- name: Setup Java
2023-05-01 07:54:14 +03:00
uses: actions/setup-java@v3
2022-07-29 20:04:37 +03:00
with:
distribution: temurin
java-version: 11
cache: gradle
- name: Cache cmake build
2024-03-03 11:27:37 +03:00
uses: actions/cache@v4
2022-07-29 20:04:37 +03:00
with:
path: os/android/app/.cxx
2025-01-14 08:45:02 +03:00
key: android-cmake-v2
2022-07-29 20:04:37 +03:00
- name: Setup signing config
if: env.KEYSTORE_FILE_BASE64 != '' && env.KEYSTORE_PROPERTIES_FILE_BASE64 != ''
2022-07-29 20:04:37 +03:00
run: |
cd os/android
echo "$KEYSTORE_FILE_BASE64" | base64 --decode > debug.keystore
echo "$KEYSTORE_PROPERTIES_FILE_BASE64" | base64 --decode > debug-keystore.properties
env:
KEYSTORE_FILE_BASE64: ${{ secrets.ANDROID_DEBUG_KEYSTORE_FILE_BASE64 }}
KEYSTORE_PROPERTIES_FILE_BASE64: ${{ secrets.ANDROID_DEBUG_KEYSTORE_PROPERTIES_FILE_BASE64 }}
- name: Build
run: |
cd os/android
./gradlew assembleDebug
- name: Upload
2024-03-03 11:27:37 +03:00
uses: actions/upload-artifact@v4
2022-07-29 20:04:37 +03:00
with:
name: fallout2-ce-debug.apk
path: os/android/app/build/outputs/apk/debug/app-debug.apk
retention-days: 7
2022-10-14 11:40:11 +03:00
ios:
name: iOS
2025-01-12 22:04:21 +03:00
runs-on: macos-13
2022-10-14 11:40:11 +03:00
steps:
- name: Clone
2024-03-03 11:27:37 +03:00
uses: actions/checkout@v4
2022-10-14 11:40:11 +03:00
- name: Cache cmake build
2024-03-03 11:27:37 +03:00
uses: actions/cache@v4
2022-10-14 11:40:11 +03:00
with:
2025-02-09 15:00:12 +03:00
path: out
key: ios-cmake-v5
2022-10-14 11:40:11 +03:00
- name: Configure
run: |
2025-02-09 15:00:12 +03:00
cmake --preset ios
2022-10-14 11:40:11 +03:00
- name: Build
run: |
2025-02-09 15:00:12 +03:00
cmake --build --preset ios-debug
2022-10-14 11:40:11 +03:00
2023-04-26 13:48:01 +03:00
- name: Pack
2022-10-14 11:40:11 +03:00
run: |
2025-02-09 15:00:12 +03:00
cd out/build/ios
cpack -C Debug
2022-10-14 11:40:11 +03:00
- name: Upload
2024-03-03 11:27:37 +03:00
uses: actions/upload-artifact@v4
2022-10-14 11:40:11 +03:00
with:
name: fallout2-ce.ipa
2025-02-09 15:00:12 +03:00
path: out/build/ios/fallout2-ce.ipa
2022-10-14 11:40:11 +03:00
retention-days: 7
2022-07-06 00:09:22 +03:00
linux:
name: Linux (${{ matrix.arch }})
runs-on: ubuntu-20.04
2022-07-05 15:45:36 +03:00
strategy:
fail-fast: false
matrix:
2022-07-06 00:09:22 +03:00
arch:
- x86
- x64
2022-07-05 15:45:36 +03:00
steps:
- name: Clone
2024-03-03 11:27:37 +03:00
uses: actions/checkout@v4
2022-06-08 21:36:39 +02:00
2022-07-06 00:09:22 +03:00
- name: Dependencies (x86)
if: matrix.arch == 'x86'
run: |
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install --allow-downgrades libpcre2-8-0=10.34-7
sudo apt install g++-multilib libsdl2-dev:i386 zlib1g-dev:i386
- name: Dependencies (x64)
if: matrix.arch == 'x64'
run: |
sudo apt update
sudo apt install libsdl2-dev zlib1g-dev
- name: Cache cmake build
2024-03-03 11:27:37 +03:00
uses: actions/cache@v4
2022-07-06 00:09:22 +03:00
with:
2025-02-09 15:00:12 +03:00
path: out
key: linux-${{ matrix.arch }}-cmake-v2
2022-07-06 00:09:22 +03:00
2025-02-09 15:00:12 +03:00
- name: Configure
2022-07-06 00:09:22 +03:00
run: |
2025-02-09 15:00:12 +03:00
cmake --preset linux-${{ matrix.arch }}-debug
2022-06-08 21:36:39 +02:00
2022-07-05 15:45:36 +03:00
- name: Build
2022-07-06 00:09:22 +03:00
run: |
2025-02-09 15:00:12 +03:00
cmake --build --preset linux-${{ matrix.arch }}-debug
2022-07-06 00:09:22 +03:00
- name: Upload
2024-03-03 11:27:37 +03:00
uses: actions/upload-artifact@v4
2022-07-05 15:45:36 +03:00
with:
2022-07-06 00:09:22 +03:00
name: fallout2-ce-linux-${{ matrix.arch }}
2025-02-09 15:00:12 +03:00
path: out/build/linux-${{ matrix.arch }}-debug/fallout2-ce
2022-07-05 15:45:36 +03:00
retention-days: 7
2025-02-10 19:19:06 +03:00
linux-arm64:
name: Linux (arm64)
runs-on: ubuntu-22.04-arm
steps:
- name: Clone
uses: actions/checkout@v4
- name: Dependencies
run: |
sudo apt update
sudo apt install libsdl2-dev zlib1g-dev
- name: Configure
run: cmake -B build -D CMAKE_BUILD_TYPE=Debug -D FALLOUT_VENDORED=OFF
- name: Build
run: cmake --build build
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fallout2-ce-linux-arm64
path: build/fallout2-ce
retention-days: 7
2022-07-05 15:45:36 +03:00
macos:
2022-07-06 00:09:22 +03:00
name: macOS
2025-01-12 22:04:21 +03:00
runs-on: macos-13
2022-07-05 15:45:36 +03:00
steps:
- name: Clone
2024-03-03 11:27:37 +03:00
uses: actions/checkout@v4
2022-07-05 15:45:36 +03:00
2022-07-06 00:09:22 +03:00
- name: Cache cmake build
2024-03-03 11:27:37 +03:00
uses: actions/cache@v4
2022-07-06 00:09:22 +03:00
with:
2025-02-09 15:00:12 +03:00
path: out
2025-01-14 08:45:02 +03:00
key: macos-cmake-v6
2022-07-06 00:09:22 +03:00
- name: Configure
run: |
2025-02-09 15:00:12 +03:00
cmake --preset macos
2022-07-06 00:09:22 +03:00
- name: Build
run: |
2025-02-09 15:00:12 +03:00
cmake --build --preset macos-debug
2022-07-06 00:09:22 +03:00
2023-05-01 07:10:04 +03:00
- name: Pack
run: |
2025-02-09 15:00:12 +03:00
cd out/build/macos
cpack -C Debug
2023-05-01 07:10:04 +03:00
2022-07-06 00:09:22 +03:00
- name: Upload
2024-03-03 11:27:37 +03:00
uses: actions/upload-artifact@v4
2022-07-06 00:09:22 +03:00
with:
name: fallout2-ce-macos.dmg
2025-02-09 15:00:12 +03:00
path: out/build/macos/Fallout II Community Edition.dmg
2022-07-06 00:09:22 +03:00
retention-days: 7
windows:
name: Windows (${{ matrix.arch }})
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
include:
- arch: x86
generator-platform: Win32
- arch: x64
generator-platform: x64
steps:
- name: Clone
2024-03-03 11:27:37 +03:00
uses: actions/checkout@v4
2022-07-06 00:09:22 +03:00
- name: Cache cmake build
2024-03-03 11:27:37 +03:00
uses: actions/cache@v4
2022-07-06 00:09:22 +03:00
with:
2025-02-09 15:00:12 +03:00
path: out
2025-01-14 08:45:02 +03:00
key: windows-${{ matrix.arch }}-cmake-v2
2022-07-06 00:09:22 +03:00
2022-07-05 15:45:36 +03:00
- name: Configure
run: |
2025-02-09 15:00:12 +03:00
cmake --preset windows-${{ matrix.arch }}
2022-07-05 15:45:36 +03:00
- name: Build
run: |
2025-02-09 15:00:12 +03:00
cmake --build --preset windows-${{ matrix.arch }}-debug
2022-07-05 15:45:36 +03:00
- name: Upload
2024-03-03 11:27:37 +03:00
uses: actions/upload-artifact@v4
2022-07-05 15:45:36 +03:00
with:
2022-07-06 00:09:22 +03:00
name: fallout2-ce-windows-${{ matrix.arch }}
2025-02-09 15:00:12 +03:00
path: out/build/windows-${{ matrix.arch }}/Debug/fallout2-ce.exe
2022-07-05 15:45:36 +03:00
retention-days: 7