2021-07-18 14:15:08 +02:00
|
|
|
name: 'Build and Test'
|
2020-11-06 06:57:25 +01:00
|
|
|
|
2021-07-07 17:07:27 +02:00
|
|
|
on: [ push ]
|
2020-11-06 06:57:25 +01:00
|
|
|
|
|
|
|
jobs:
|
2020-11-22 16:16:38 +01:00
|
|
|
build:
|
2021-07-18 14:15:08 +02:00
|
|
|
name: 'Build'
|
2020-11-20 15:34:49 +01:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
2021-07-02 20:17:02 +02:00
|
|
|
fail-fast: false
|
2020-11-20 15:34:49 +01:00
|
|
|
matrix:
|
2021-06-07 08:53:43 +02:00
|
|
|
platform: [ linux, javascript, osx, windows ]
|
2020-11-22 16:16:38 +01:00
|
|
|
target: [ release, debug ]
|
2020-11-20 15:34:49 +01:00
|
|
|
bits: [ 64, 32 ]
|
|
|
|
include:
|
|
|
|
- platform: linux
|
|
|
|
os: ubuntu-latest
|
2021-06-07 08:53:43 +02:00
|
|
|
- platform: javascript
|
|
|
|
os: ubuntu-latest
|
2020-11-20 15:34:49 +01:00
|
|
|
- platform: osx
|
|
|
|
os: macos-latest
|
|
|
|
- platform: windows
|
|
|
|
os: windows-latest
|
|
|
|
exclude:
|
2021-06-07 08:53:43 +02:00
|
|
|
- platform: javascript
|
|
|
|
bits: 64 # Currently only wasm32 is supported.
|
2020-11-20 15:34:49 +01:00
|
|
|
- platform: osx
|
|
|
|
bits: 32 # Only 64-bit supported on macOS.
|
2020-11-10 04:04:08 +01:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
2020-11-20 15:34:49 +01:00
|
|
|
|
|
|
|
- name: Get godot-cpp submodule commit hash
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
2020-11-10 04:04:08 +01:00
|
|
|
run: |
|
2021-06-12 10:02:22 +02:00
|
|
|
echo ::set-env name=GODOT_CPP_COMMIT_HASH::$(git ls-tree HEAD addons/godot_xterm/native/thirdparty/godot-cpp -l | cut -d\ -f3)
|
2020-11-20 15:34:49 +01:00
|
|
|
- name: Cache godot-cpp bindings
|
|
|
|
uses: actions/cache@v2
|
|
|
|
id: cache
|
|
|
|
env:
|
|
|
|
cache-name: cache-godot-cpp
|
2020-11-10 04:04:08 +01:00
|
|
|
with:
|
2021-06-12 10:02:22 +02:00
|
|
|
path: addons/godot_xterm/native/thirdparty/godot-cpp
|
2021-07-18 11:06:38 +02:00
|
|
|
key: godot-cpp-v1-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.bits }}-${{ env.GODOT_CPP_COMMIT_HASH }}
|
2021-07-02 19:27:34 +02:00
|
|
|
- name: Get libuv submodule commit hash
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
|
|
|
run: |
|
|
|
|
echo ::set-env name=LIBUV_COMMIT_HASH::$(git ls-tree HEAD addons/godot_xterm/native/thirdparty/libuv -l | cut -d\ -f3)
|
|
|
|
- name: Cache libuv
|
|
|
|
uses: actions/cache@v2
|
|
|
|
id: cache-libuv
|
|
|
|
with:
|
|
|
|
path: addons/godot_xterm/native/thirdparty/libuv
|
2021-07-18 11:06:38 +02:00
|
|
|
key: libuv-cache-v1-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.bits }}-${{ env.LIBUV_COMMIT_HASH }}
|
2021-06-07 08:53:43 +02:00
|
|
|
- name: Cache emscripten
|
|
|
|
if: ${{ matrix.platform == 'javascript' }}
|
|
|
|
uses: actions/cache@v2
|
|
|
|
env:
|
|
|
|
cache-name: cache-emscripten
|
|
|
|
with:
|
|
|
|
path: addons/godot_xterm/native/.emcache
|
2021-07-18 11:06:38 +02:00
|
|
|
key: emsdk-cache-v1-${{ matrix.target }}
|
2020-11-20 15:34:49 +01:00
|
|
|
|
2020-11-22 16:16:38 +01:00
|
|
|
# Ubuntu-specific steps.
|
2020-11-20 15:34:49 +01:00
|
|
|
- name: Install ubuntu build dependencies
|
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
|
|
run: sudo apt-get install -y scons gcc-multilib g++-multilib
|
|
|
|
|
2021-06-07 08:53:43 +02:00
|
|
|
# JavaScript-specific steps.
|
|
|
|
- name: Install javascript build dependencies
|
|
|
|
if: ${{ matrix.platform == 'javascript' }}
|
|
|
|
uses: mymindstorm/setup-emsdk@v9
|
|
|
|
with:
|
|
|
|
version: 2.0.10
|
|
|
|
actions-cache-folder: emsdk-cache-${{ matrix.target }}
|
|
|
|
|
2020-11-22 16:16:38 +01:00
|
|
|
# MacOS-specific steps.
|
2020-11-20 15:34:49 +01:00
|
|
|
- name: Install additional macos build dependencies
|
|
|
|
if: ${{ matrix.os == 'macos-latest' }}
|
2020-11-20 03:00:03 +01:00
|
|
|
run: brew install scons
|
2020-11-20 15:34:49 +01:00
|
|
|
|
2020-11-22 16:16:38 +01:00
|
|
|
# Windows-specific steps.
|
2020-11-20 15:34:49 +01:00
|
|
|
- name: Install additional windows build dependencies
|
|
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
2020-11-22 16:45:02 +01:00
|
|
|
run: python -m pip install scons
|
2021-07-03 10:15:01 +02:00
|
|
|
- uses: ilammy/msvc-dev-cmd@v1.9.0
|
2020-11-20 15:34:49 +01:00
|
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
2021-07-03 10:15:01 +02:00
|
|
|
with:
|
|
|
|
arch: win${{ matrix.bits }}
|
2020-11-20 15:34:49 +01:00
|
|
|
|
|
|
|
- name: Build godot-cpp bindings
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
2021-06-12 10:02:22 +02:00
|
|
|
cd addons/godot_xterm/native/thirdparty/godot-cpp
|
2020-11-22 16:16:38 +01:00
|
|
|
scons platform=${{ matrix.platform }} target=${{ matrix.target }} bits=${{ matrix.bits }} generate_bindings=yes -j2
|
2020-11-20 15:34:49 +01:00
|
|
|
|
2021-07-16 09:31:13 +02:00
|
|
|
- name: Setup cmake
|
|
|
|
if: steps.cache-libuv.outputs.cache-hit != 'true'
|
|
|
|
uses: jwlawson/actions-setup-cmake@v1.9
|
2021-07-02 19:27:34 +02:00
|
|
|
with:
|
2021-07-16 09:31:13 +02:00
|
|
|
cmake-version: '3.15.4'
|
|
|
|
use-32bit: ${{ matrix.bits == 32 && matrix.os == 'windows-latest' }}
|
|
|
|
- name: Build libuv
|
|
|
|
if: steps.cache-libuv.outputs.cache-hit != 'true'
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
TARGET: ${{ matrix.target }}
|
|
|
|
BITS: ${{ matrix.bits }}
|
|
|
|
OS: ${{ matrix.os }}
|
|
|
|
run: |
|
|
|
|
cd addons/godot_xterm/native/thirdparty/libuv
|
|
|
|
args="-DCMAKE_BUILD_TYPE=$TARGET -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE"
|
2021-07-18 11:06:38 +02:00
|
|
|
if [ "$TARGET" == "release" ]; then
|
|
|
|
args="$args -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL"
|
|
|
|
else
|
|
|
|
args="$args -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL"
|
|
|
|
fi
|
2021-07-16 09:31:13 +02:00
|
|
|
if [ "$BITS" -eq 32 -a "$OS" == "windows-latest" ]; then
|
|
|
|
cmake -G "Visual Studio 16 2019" -A Win32 -S $(pwd) -B "build" $args
|
|
|
|
else
|
|
|
|
mkdir build || true
|
|
|
|
cd build
|
|
|
|
if [ "$BITS" -eq 32 ]; then args="$args -DCMAKE_SYSTEM_PROCESSOR=i686 -DCMAKE_C_FLAGS=-m32"; fi
|
|
|
|
cmake .. $args
|
|
|
|
cd ..
|
|
|
|
fi
|
|
|
|
cmake --build build --config $TARGET
|
2021-07-02 19:27:34 +02:00
|
|
|
|
2020-11-20 15:34:49 +01:00
|
|
|
- name: Build libgodot-xterm
|
2020-11-20 03:00:03 +01:00
|
|
|
run: |
|
|
|
|
cd addons/godot_xterm/native
|
2021-07-18 11:06:38 +02:00
|
|
|
scons platform=${{ matrix.platform }} target=${{ matrix.target }} bits=${{ matrix.bits }} -j2
|
2020-11-20 15:34:49 +01:00
|
|
|
|
|
|
|
- name: Upload build artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
2020-11-20 03:00:03 +01:00
|
|
|
with:
|
2020-11-22 16:56:20 +01:00
|
|
|
name: libgodot-xterm-${{ matrix.target }}
|
2020-11-20 15:34:49 +01:00
|
|
|
path: |
|
|
|
|
addons/godot_xterm/native/bin/*.so
|
2021-06-07 08:53:43 +02:00
|
|
|
addons/godot_xterm/native/bin/*.wasm
|
2020-11-20 15:34:49 +01:00
|
|
|
addons/godot_xterm/native/bin/*.dylib
|
|
|
|
addons/godot_xterm/native/bin/*.dll
|
|
|
|
|
2021-07-18 14:15:08 +02:00
|
|
|
test:
|
|
|
|
name: 'Test'
|
|
|
|
needs: build
|
|
|
|
env:
|
|
|
|
GODOT: Godot_v3.3.2-stable_${{ matrix.platform }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
platform: [ x11.64 ] #, x11.32, win64.exe, win32.exe, osx.universal ]
|
|
|
|
target: [ release, debug ]
|
|
|
|
include:
|
|
|
|
- platform: x11.64
|
|
|
|
os: ubuntu-latest
|
|
|
|
# For Windows platform we need to install mesa-dist-win.
|
|
|
|
# 32 bit X11 and MacOS also needs special attention.
|
|
|
|
# So disable all of them for now.
|
|
|
|
#- platform: x11.32
|
|
|
|
# os: ubuntu-latest
|
|
|
|
#- platform: win64.exe
|
|
|
|
# os: windows-latest
|
|
|
|
#- platform: win32.exe
|
|
|
|
# os: windows-latest
|
|
|
|
#- platform: osx.universal
|
|
|
|
# os: macos-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
- name: Cache Godot
|
|
|
|
uses: actions/cache@v2
|
|
|
|
id: cache-godot
|
|
|
|
env:
|
|
|
|
cache-name: cache-godot
|
|
|
|
with:
|
|
|
|
path: godot_executable/
|
|
|
|
key: godot-cache-v1-${{ env.GODOT }}
|
|
|
|
|
|
|
|
#- name: Install 32 bit dependencies on 64 bit Ubuntu
|
|
|
|
# if: ${{ matrix.platform == 'x11.32' }}
|
|
|
|
# run: sudo apt-get install -y libxcursor-dev:i386
|
|
|
|
- name: Install Ubuntu dependencies
|
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
|
|
run: sudo apt-get install -y pulseaudio
|
|
|
|
|
|
|
|
- name: Download Godot
|
|
|
|
uses: suisei-cn/actions-download-file@v1
|
|
|
|
if: steps.cache-godot.outputs.cache-hit != 'true'
|
|
|
|
with:
|
|
|
|
url: https://downloads.tuxfamily.org/godotengine/3.3.2/${{ env.GODOT }}.zip
|
|
|
|
target: godot_executable/
|
|
|
|
- name: Extract Godot
|
|
|
|
shell: bash
|
|
|
|
if: steps.cache-godot.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
cd godot_executable
|
|
|
|
unzip ${{ env.GODOT }}.zip
|
|
|
|
- name: Symlink Godot
|
|
|
|
if: ${{ matrix.platform == 'osx.universal' }}
|
|
|
|
run: ln -s godot_executable/Godot.app/Contents/MacOS/Godot godot_executable/${{ env.GODOT }}
|
|
|
|
|
|
|
|
- name: Install binary build artifacts
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: libgodot-xterm-${{ matrix.target }}
|
|
|
|
path: addons/godot_xterm/native/bin
|
|
|
|
|
|
|
|
- name: Install plugins
|
|
|
|
uses: GabrielBB/xvfb-action@v1
|
|
|
|
with:
|
|
|
|
run: godot_executable/${{ env.GODOT }} --no-window -s plug.gd install
|
|
|
|
|
|
|
|
- name: Import files
|
|
|
|
uses: GabrielBB/xvfb-action@v1
|
|
|
|
with:
|
|
|
|
run: ./godot_executable/${{ env.GODOT }} --editor --quit
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
uses: GabrielBB/xvfb-action@v1
|
|
|
|
with:
|
|
|
|
run: ./godot_executable/${{ env.GODOT }} --no-window -s addons/gut/gut_cmdln.gd -gconfig=test/.gutconfig.ci.json
|
|
|
|
|
|
|
|
- name: Run unix tests
|
|
|
|
if: ${{ matrix.platform != 'win64.exe' && matrix.platform != 'win32.exe' }}
|
|
|
|
uses: GabrielBB/xvfb-action@v1
|
|
|
|
with:
|
|
|
|
run: ./godot_executable/${{ env.GODOT }} --no-window -s addons/gut/gut_cmdln.gd -gconfig=test/.gutconfig.unix.json
|
|
|
|
|