278 lines
6.5 KiB
YAML
278 lines
6.5 KiB
YAML
name: Taisei Test Builds (CI)
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- v1.*
|
|
tags:
|
|
- v1.*
|
|
paths:
|
|
- "**.c"
|
|
- "**.h"
|
|
- "**.yml"
|
|
- "**.yaml"
|
|
- "**.build"
|
|
pull_request:
|
|
paths:
|
|
- "**.c"
|
|
- "**.h"
|
|
- "**.yml"
|
|
- "**.yaml"
|
|
- "**.build"
|
|
|
|
# TODO: use later fixed version of emscripten when it releases
|
|
env:
|
|
EM_VERSION: '2.0.19'
|
|
EM_CACHE_FOLDER: 'emsdk'
|
|
TAISEI_NOPRELOAD: 0
|
|
TAISEI_PRELOAD_REQUIRED: 1
|
|
|
|
jobs:
|
|
linux-test-build:
|
|
name: Linux Test Build (x64)
|
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'recursive'
|
|
|
|
- name: Install Python
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: '3.x'
|
|
|
|
- name: Install Build Tools (apt)
|
|
run: >
|
|
sudo apt update || true
|
|
|
|
sudo apt install -y -qq
|
|
build-essential
|
|
libsdl2-dev
|
|
libogg-dev
|
|
libopusfile-dev
|
|
libpng-dev
|
|
libzip-dev
|
|
libx11-dev
|
|
libwayland-dev
|
|
python3-docutils
|
|
libwebp-dev
|
|
libfreetype6-dev
|
|
libzstd-dev
|
|
|
|
pip install
|
|
meson==0.56.2
|
|
ninja
|
|
zstandard
|
|
|
|
- name: Configure
|
|
run: >
|
|
meson setup build/
|
|
--native-file misc/ci/linux-x86_64-build-test-ci.ini
|
|
--prefix=$(pwd)/build-test
|
|
|
|
- name: Build
|
|
run: |
|
|
meson compile -C build/ --verbose
|
|
meson install -C build/
|
|
|
|
- name: Run Test
|
|
run: $(pwd)/build-test/bin/taisei -R $(pwd)/misc/ci/tests/test-replay.tsr
|
|
env:
|
|
TAISEI_NOPRELOAD: ${{ env.TAISEI_NOPRELOAD }}
|
|
TAISEI_PRELOAD_REQUIRED: ${{ env.TAISEI_PRELOAD_REQUIRED }}
|
|
|
|
- name: Upload Log
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: taisei_linux_fail_log
|
|
path: build/meson-logs/meson-log.txt
|
|
if-no-files-found: warn
|
|
|
|
macos-test-build:
|
|
name: macOS Test Build (x64)
|
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
|
runs-on: macos-10.15
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'recursive'
|
|
|
|
- name: Set Up Build Environment
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: '3.x'
|
|
|
|
- name: Install Build Tools
|
|
run: >
|
|
brew install
|
|
gcc
|
|
pkg-config
|
|
docutils
|
|
pygments
|
|
freetype2
|
|
libzip
|
|
opusfile
|
|
libvorbis
|
|
webp
|
|
sdl2
|
|
ninja
|
|
|
|
pip install
|
|
meson==0.56.2
|
|
ninja
|
|
zstandard
|
|
|
|
- name: Configure
|
|
run: >
|
|
meson setup build/
|
|
--native-file misc/ci/macos-x86_64-build-test-ci.ini
|
|
--prefix=$(pwd)/build-test
|
|
|
|
- name: Build
|
|
run: |
|
|
meson compile -C build/ --verbose
|
|
meson install -C build/
|
|
|
|
- name: Run Test
|
|
run: $(pwd)/build-test/Taisei.app/Contents/MacOS/Taisei -R $(pwd)/misc/ci/tests/test-replay.tsr
|
|
env:
|
|
TAISEI_NOPRELOAD: ${{ env.TAISEI_NOPRELOAD }}
|
|
TAISEI_PRELOAD_REQUIRED: ${{ env.TAISEI_PRELOAD_REQUIRED }}
|
|
|
|
- name: Upload Log
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: taisei_macos_fail_log
|
|
path: build/meson-logs/meson-log.txt
|
|
if-no-files-found: warn
|
|
|
|
windows-test-build:
|
|
name: Windows Test Build (x64)
|
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
|
runs-on: ubuntu-20.04
|
|
container: mstorsjo/llvm-mingw:20210423 # cross-compiler with mingw
|
|
steps:
|
|
- name: Install tools (Apt)
|
|
run: >
|
|
apt update || true
|
|
|
|
apt install -y -qq software-properties-common
|
|
|
|
add-apt-repository ppa:git-core/ppa -y
|
|
|
|
apt install -y -qq
|
|
python3-docutils
|
|
python3-pip
|
|
git
|
|
nsis
|
|
|
|
pip3 install
|
|
meson==0.56.2
|
|
ninja
|
|
zstandard
|
|
|
|
- name: Checkout Code (Git)
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'recursive'
|
|
|
|
- name: Configure Taisei (Meson)
|
|
run: >
|
|
meson setup build/
|
|
--cross-file misc/ci/windows-llvm_mingw-x86_64-build-test-ci.ini
|
|
--prefix=$(pwd)/build-test
|
|
|
|
- name: Build
|
|
run: |
|
|
meson compile -C build/ --verbose
|
|
meson install -C build/
|
|
|
|
- name: Upload Log
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: taisei_windows_fail_log
|
|
path: build/meson-logs/meson-log.txt
|
|
if-no-files-found: warn
|
|
|
|
emscripten-test-build:
|
|
name: Emscripten Test Build (WebGL)
|
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'recursive'
|
|
|
|
- name: Set Up Build Environment
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: '3.x'
|
|
|
|
- name: Install Build Tools
|
|
run: >
|
|
sudo apt update || true
|
|
|
|
sudo apt install -y -qq
|
|
python3-docutils
|
|
python3-pip
|
|
git
|
|
|
|
pip install
|
|
meson==0.56.2
|
|
ninja
|
|
zstandard
|
|
|
|
- name: Pull cached emsdk
|
|
id: cache-emsdk
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ env.EM_CACHE_FOLDER }}
|
|
key: ${{ env.EM_VERSION }}-${{ runner.os }}
|
|
|
|
- name: Install emsdk
|
|
if: steps.cache-emsdk.outputs.cache-hit != 'true'
|
|
run: |
|
|
rm -rf emsdk/
|
|
git clone https://github.com/emscripten-core/emsdk.git
|
|
emsdk/emsdk install ${{ env.EM_VERSION }}
|
|
emsdk/emsdk activate ${{ env.EM_VERSION }}
|
|
|
|
- name: Verify emsdk
|
|
run: |
|
|
source emsdk/emsdk_env.sh
|
|
emcc -v
|
|
tee misc/ci/emscripten-ephemeral-ci.ini <<EOF >/dev/null
|
|
[constants]
|
|
toolchain = '$(pwd)/emsdk/upstream/emscripten/'
|
|
EOF
|
|
|
|
- name: Configure
|
|
run: >
|
|
source emsdk/emsdk_env.sh
|
|
|
|
meson setup build/
|
|
--cross-file misc/ci/emscripten-ephemeral-ci.ini
|
|
--cross-file misc/ci/emscripten-build-test-ci.ini
|
|
--prefix=$(pwd)/build-test
|
|
|
|
meson configure
|
|
-Dbuild.cpp_std=gnu++14
|
|
build/
|
|
|
|
- name: Build
|
|
run: |
|
|
source emsdk/emsdk_env.sh
|
|
# run twice due to a header race condition with SPIRV-Tools
|
|
meson compile tar -C build/ --verbose || true
|
|
meson compile tar -C build/ --verbose
|
|
|
|
- name: Upload Log
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: taisei_emscripten_build_log
|
|
path: build/emscripten/meson-logs/meson-log.txt
|
|
if-no-files-found: warn
|