2024-02-12 22:50:19 +01:00
|
|
|
name: "Build and Test"
|
2020-11-06 06:57:25 +01:00
|
|
|
|
2021-07-23 15:44:17 +02:00
|
|
|
on:
|
|
|
|
push:
|
2024-05-10 12:29:32 +02:00
|
|
|
schedule: # Build and test weekly.
|
|
|
|
- cron: 8 2 * * thu
|
2020-11-06 06:57:25 +01:00
|
|
|
|
|
|
|
jobs:
|
2024-02-13 09:23:22 +01:00
|
|
|
build-linux:
|
2024-03-31 23:00:10 +02:00
|
|
|
name: "Build (linux, ${{ matrix.arch }}, ${{ matrix.target }}) #${{ github.run_number }}"
|
2022-08-27 10:32:03 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2022-06-01 05:26:03 +02:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-02-12 22:50:19 +01:00
|
|
|
arch: [x86_64, x86_32]
|
2024-02-17 23:50:38 +01:00
|
|
|
target: [release, debug]
|
2022-06-01 05:26:03 +02:00
|
|
|
steps:
|
2024-02-12 23:14:52 +01:00
|
|
|
- uses: actions/checkout@v4
|
2022-06-01 05:26:03 +02:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
- name: Cache submodules
|
|
|
|
uses: ./.github/actions/cache-submodules
|
|
|
|
id: cache-submodules
|
|
|
|
with:
|
|
|
|
platform: linux
|
2023-01-25 19:12:07 +01:00
|
|
|
arch: ${{ matrix.arch }}
|
2024-02-13 03:22:16 +01:00
|
|
|
target: ${{ matrix.target }}
|
2022-06-01 05:26:03 +02:00
|
|
|
- name: Pull docker images
|
|
|
|
run: docker-compose pull
|
|
|
|
working-directory: addons/godot_xterm/native
|
|
|
|
- name: Cache docker image layers
|
2023-01-25 19:12:07 +01:00
|
|
|
uses: jpribyl/action-docker-layer-caching@v0.1.1
|
2022-06-01 05:26:03 +02:00
|
|
|
continue-on-error: true
|
2023-01-25 19:12:07 +01:00
|
|
|
- name: Ensure scons cache exists
|
|
|
|
run: mkdir -p ${{github.workspace}}/.scons-cache
|
2022-06-01 05:26:03 +02:00
|
|
|
- name: Build libuv
|
|
|
|
if: steps.cache-submodules.outputs.cache-hit != 'true'
|
|
|
|
working-directory: addons/godot_xterm/native
|
2023-01-25 19:12:07 +01:00
|
|
|
run: UID_GID="$(id -u):$(id -g)" docker-compose run -e TARGET=${{ matrix.target }} -e ARCH=${{ matrix.arch }} -v ${{github.workspace}}/.scons-cache:/scons-cache libuv-linux
|
2022-06-01 05:26:03 +02:00
|
|
|
- name: Build libgodot-xterm
|
|
|
|
working-directory: addons/godot_xterm/native
|
2023-01-25 19:12:07 +01:00
|
|
|
run: UID_GID="$(id -u):$(id -g)" docker-compose run -e TARGET=${{ matrix.target }} -e ARCH=${{ matrix.arch }} -v ${{github.workspace}}/.scons-cache:/scons-cache libgodot-xterm-linux
|
2022-06-01 05:26:03 +02:00
|
|
|
- name: Upload binaries
|
2024-02-23 21:27:10 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-06-01 05:26:03 +02:00
|
|
|
with:
|
2024-02-23 21:27:10 +01:00
|
|
|
name: libgodot-xterm-linux-${{ matrix.arch }}-${{ matrix.target }}
|
|
|
|
path: addons/godot_xterm/native/bin/*.so
|
2022-06-01 05:26:03 +02:00
|
|
|
|
2024-02-13 09:23:22 +01:00
|
|
|
build-other-platforms:
|
2024-03-31 23:00:10 +02:00
|
|
|
name: "Build (${{ matrix.platform }}, ${{ matrix.arch }}, ${{ matrix.target}}) #${{ github.run_number }}"
|
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:
|
2024-02-13 03:22:16 +01:00
|
|
|
platform: [web, macos, windows]
|
2024-02-17 23:50:38 +01:00
|
|
|
target: [release, debug]
|
2024-02-25 00:24:59 +01:00
|
|
|
arch: [wasm32, universal, x86_64, x86_32]
|
2020-11-20 15:34:49 +01:00
|
|
|
include:
|
2024-02-13 03:22:16 +01:00
|
|
|
- platform: web
|
2022-08-27 10:32:03 +02:00
|
|
|
os: ubuntu-22.04
|
2024-02-13 03:22:16 +01:00
|
|
|
- platform: macos
|
2022-08-27 10:32:03 +02:00
|
|
|
os: macos-12
|
2020-11-20 15:34:49 +01:00
|
|
|
- platform: windows
|
2022-08-27 10:32:03 +02:00
|
|
|
os: windows-2022
|
2024-02-25 00:24:59 +01:00
|
|
|
exclude:
|
2024-02-13 03:22:16 +01:00
|
|
|
- platform: web
|
2024-02-25 00:24:59 +01:00
|
|
|
arch: x86_64
|
|
|
|
- platform: web
|
|
|
|
arch: x86_32
|
|
|
|
- platform: web
|
|
|
|
arch: universal
|
|
|
|
- platform: macos
|
2024-02-13 03:22:16 +01:00
|
|
|
arch: wasm32
|
|
|
|
- platform: macos
|
|
|
|
arch: x86_64
|
2024-02-25 00:24:59 +01:00
|
|
|
- platform: macos
|
2024-02-13 03:22:16 +01:00
|
|
|
arch: x86_32
|
2024-02-25 00:24:59 +01:00
|
|
|
- platform: windows
|
|
|
|
arch: wasm32
|
|
|
|
- platform: windows
|
|
|
|
arch: universal
|
2020-11-10 04:04:08 +01:00
|
|
|
steps:
|
2024-02-12 23:14:52 +01:00
|
|
|
- uses: actions/checkout@v4
|
2020-11-10 04:04:08 +01:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2022-06-01 04:54:06 +02:00
|
|
|
- name: Cache submodules
|
|
|
|
uses: ./.github/actions/cache-submodules
|
|
|
|
id: cache-submodules
|
2021-07-02 19:27:34 +02:00
|
|
|
with:
|
2022-06-01 04:54:06 +02:00
|
|
|
platform: ${{ matrix.platform }}
|
|
|
|
target: ${{ matrix.target }}
|
2024-02-13 03:22:16 +01:00
|
|
|
arch: ${{ matrix.arch }}
|
2021-06-07 08:53:43 +02:00
|
|
|
- name: Cache emscripten
|
2024-02-13 03:22:16 +01:00
|
|
|
if: ${{ matrix.platform == 'web' }}
|
2024-03-29 13:51:19 +01:00
|
|
|
uses: actions/cache@v4
|
2021-06-07 08:53:43 +02:00
|
|
|
env:
|
|
|
|
cache-name: cache-emscripten
|
|
|
|
with:
|
|
|
|
path: addons/godot_xterm/native/.emcache
|
2023-01-25 19:12:07 +01:00
|
|
|
key: emsdk-cache-${{ matrix.target }}-${{ hashFiles('**/*.c*', '**/*.h*') }}
|
|
|
|
restore-keys: |
|
|
|
|
emsdk-cache-${{ matrix.target }}-
|
2024-02-13 03:22:16 +01:00
|
|
|
- name: Install web build dependencies
|
|
|
|
if: ${{ matrix.platform == 'web' }}
|
2024-03-29 14:42:40 +01:00
|
|
|
uses: mymindstorm/setup-emsdk@v14
|
2021-06-07 08:53:43 +02:00
|
|
|
with:
|
2022-08-01 09:56:43 +02:00
|
|
|
version: 3.1.14
|
2021-06-07 08:53:43 +02:00
|
|
|
actions-cache-folder: emsdk-cache-${{ matrix.target }}
|
2024-02-13 03:22:16 +01:00
|
|
|
- name: Install additional web build dependencies
|
|
|
|
if: ${{ matrix.platform == 'web' }}
|
2022-06-01 05:26:03 +02:00
|
|
|
run: sudo apt-get update && sudo apt-get install -y scons gcc-multilib g++-multilib
|
2020-11-20 15:34:49 +01:00
|
|
|
- name: Install additional macos build dependencies
|
2024-02-24 07:53:24 +01:00
|
|
|
if: ${{ matrix.platform == 'macos' }}
|
2020-11-20 03:00:03 +01:00
|
|
|
run: brew install scons
|
2020-11-20 15:34:49 +01:00
|
|
|
- name: Install additional windows build dependencies
|
2024-02-24 07:53:24 +01:00
|
|
|
if: ${{ matrix.platform == 'windows' }}
|
2020-11-22 16:45:02 +01:00
|
|
|
run: python -m pip install scons
|
2022-06-01 05:26:03 +02:00
|
|
|
- name: Setup MSVC command prompt
|
2022-08-27 10:46:41 +02:00
|
|
|
uses: ilammy/msvc-dev-cmd@v1
|
2024-02-24 07:53:24 +01:00
|
|
|
if: ${{ matrix.platform == 'windows' }}
|
2021-07-03 10:15:01 +02:00
|
|
|
with:
|
2024-02-25 00:24:59 +01:00
|
|
|
arch: win${{ matrix.arch == 'x86_64' && '64' || '32' }}
|
2021-07-16 09:31:13 +02:00
|
|
|
- name: Setup cmake
|
2022-06-01 04:54:06 +02:00
|
|
|
if: steps.cache-submodules.outputs.cache-hit != 'true'
|
2024-02-12 22:12:04 +01:00
|
|
|
uses: jwlawson/actions-setup-cmake@v2
|
2021-07-02 19:27:34 +02:00
|
|
|
with:
|
2024-02-12 22:50:19 +01:00
|
|
|
cmake-version: "3.23.2"
|
2024-02-25 00:24:59 +01:00
|
|
|
use-32bit: ${{ matrix.arch == 'x86_32' && matrix.platform == 'windows' }}
|
2021-07-16 09:31:13 +02:00
|
|
|
- name: Build libuv
|
2022-06-01 04:54:06 +02:00
|
|
|
if: steps.cache-submodules.outputs.cache-hit != 'true'
|
2021-07-16 09:31:13 +02:00
|
|
|
shell: bash
|
|
|
|
env:
|
2024-02-24 07:53:24 +01:00
|
|
|
PLATFORM: ${{ matrix.platform }}
|
2021-07-16 09:31:13 +02:00
|
|
|
TARGET: ${{ matrix.target }}
|
2024-02-25 00:24:59 +01:00
|
|
|
BITS: ${{ matrix.arch == 'x86_64' && 64 || 32 }}
|
2021-07-16 09:31:13 +02:00
|
|
|
run: |
|
|
|
|
cd addons/godot_xterm/native/thirdparty/libuv
|
2022-05-31 15:14:41 +02:00
|
|
|
args="-DCMAKE_BUILD_TYPE=$TARGET -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \
|
|
|
|
-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64"
|
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
|
2024-02-24 07:53:24 +01:00
|
|
|
if [ "$BITS" -eq 32 -a "$PLATFORM" == "windows" ]; then
|
2022-06-01 04:41:59 +02:00
|
|
|
cmake -G "Visual Studio 17 2022" -A Win32 -S $(pwd) -B "build" $args
|
2021-07-16 09:31:13 +02:00
|
|
|
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
|
2024-02-13 03:22:16 +01:00
|
|
|
- name: Ensure scons cache exists
|
|
|
|
run: mkdir -p ${{github.workspace}}/.scons-cache
|
|
|
|
shell: bash
|
2020-11-20 15:34:49 +01:00
|
|
|
- name: Build libgodot-xterm
|
2024-02-13 03:22:16 +01:00
|
|
|
env:
|
|
|
|
SCONS_CACHE: ${{github.workspace}}/.scons-cache
|
2020-11-20 03:00:03 +01:00
|
|
|
run: |
|
|
|
|
cd addons/godot_xterm/native
|
2024-03-02 09:51:24 +01:00
|
|
|
scons platform=${{ matrix.platform }} target=template_${{ matrix.target }} arch=${{ matrix.arch }} debug_symbols=${{ matrix.platform != 'windows' && matrix.target == 'debug' && 'yes' || 'no' }} -j2
|
2022-06-01 05:26:03 +02:00
|
|
|
- name: Upload binaries
|
2024-02-23 21:27:10 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2020-11-20 03:00:03 +01:00
|
|
|
with:
|
2024-02-23 21:27:10 +01:00
|
|
|
name: libgodot-xterm-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.target }}
|
2020-11-20 15:34:49 +01:00
|
|
|
path: |
|
2024-02-23 21:27:10 +01:00
|
|
|
addons/godot_xterm/native/bin/*.so
|
2021-06-07 08:53:43 +02:00
|
|
|
addons/godot_xterm/native/bin/*.wasm
|
2024-02-23 21:27:10 +01:00
|
|
|
addons/godot_xterm/native/bin/*.framework
|
2024-02-24 07:47:12 +01:00
|
|
|
addons/godot_xterm/native/bin/spawn-helper
|
2024-02-23 21:27:10 +01:00
|
|
|
addons/godot_xterm/native/bin/*.xcframework
|
2020-11-20 15:34:49 +01:00
|
|
|
addons/godot_xterm/native/bin/*.dll
|
|
|
|
|
2024-03-30 03:24:32 +01:00
|
|
|
web-export:
|
|
|
|
name: "Web Export"
|
2022-08-27 10:32:03 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2021-07-24 06:40:29 +02:00
|
|
|
steps:
|
2024-02-12 23:14:52 +01:00
|
|
|
- uses: actions/checkout@v4
|
2024-03-30 03:24:32 +01:00
|
|
|
- id: install-chrome
|
|
|
|
uses: browser-actions/setup-chrome@v1
|
|
|
|
with:
|
|
|
|
chrome-version: 121
|
2024-02-12 22:50:19 +01:00
|
|
|
- name: Setup Godot
|
2024-02-12 23:14:52 +01:00
|
|
|
uses: lihop/setup-godot@v2
|
2024-02-12 22:50:19 +01:00
|
|
|
with:
|
2024-02-23 21:27:10 +01:00
|
|
|
version: "4.2.1-stable"
|
2024-03-30 03:24:32 +01:00
|
|
|
export-templates: true
|
2024-02-24 03:48:48 +01:00
|
|
|
- name: Import assets
|
|
|
|
run: godot --editor --headless --quit-after 100 || true
|
2024-03-31 22:36:10 +02:00
|
|
|
- name: Wait for wasm build
|
2024-03-29 13:51:15 +01:00
|
|
|
uses: fountainhead/action-wait-for-check@v1.2.0
|
2024-02-23 21:27:10 +01:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2024-03-31 23:00:10 +02:00
|
|
|
checkName: "Build (web, wasm32, release) #${{ github.run_number }}"
|
2024-02-23 21:27:10 +01:00
|
|
|
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
2024-03-31 22:36:10 +02:00
|
|
|
- name: Wait for linux build # Required for linux-based editor to recognize the GDExtension node types.
|
|
|
|
uses: fountainhead/action-wait-for-check@v1.2.0
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2024-03-31 23:00:10 +02:00
|
|
|
checkName: "Build (linux, x86_64, debug) #${{ github.run_number }}"
|
2024-03-31 22:36:10 +02:00
|
|
|
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
2024-02-12 22:50:19 +01:00
|
|
|
- name: Install binary build artifacts
|
2024-02-23 21:27:10 +01:00
|
|
|
uses: actions/download-artifact@v4
|
2024-02-12 22:50:19 +01:00
|
|
|
with:
|
|
|
|
path: addons/godot_xterm/native/bin
|
2024-02-24 04:24:54 +01:00
|
|
|
merge-multiple: true
|
2024-03-30 03:24:32 +01:00
|
|
|
- name: Export for web
|
2024-03-31 22:36:10 +02:00
|
|
|
shell: bash
|
|
|
|
run: godot --no-window --export-release Web
|
2024-02-12 22:50:19 +01:00
|
|
|
- name: NPM cache
|
|
|
|
uses: c-hive/gha-npm-cache@v1
|
|
|
|
with:
|
2024-03-30 03:24:32 +01:00
|
|
|
directory: test/web
|
|
|
|
- name: Smoke test Web export
|
2024-02-12 22:50:19 +01:00
|
|
|
shell: bash
|
2024-03-30 03:24:32 +01:00
|
|
|
working-directory: test/web
|
2024-02-12 22:50:19 +01:00
|
|
|
run: |
|
2024-03-30 03:24:32 +01:00
|
|
|
export GODOT_XTERM_CHROME_PATH=${{ steps.install-chrome.outputs.chrome-path }}
|
2024-02-12 22:50:19 +01:00
|
|
|
npm ci
|
2024-03-30 03:24:32 +01:00
|
|
|
npm test
|
2024-02-12 22:50:19 +01:00
|
|
|
- name: Upload export
|
2024-02-23 11:57:20 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2024-02-12 22:50:19 +01:00
|
|
|
with:
|
2024-03-30 03:24:32 +01:00
|
|
|
name: web-demo
|
2024-02-12 22:50:19 +01:00
|
|
|
path: docs/demo
|
2021-07-20 02:27:07 +02:00
|
|
|
|
2021-07-24 06:40:29 +02:00
|
|
|
test:
|
2024-03-03 02:08:09 +01:00
|
|
|
name: Test (${{ matrix.platform }}, ${{ matrix.arch }}, ${{ matrix.godot-version }})
|
2021-07-23 15:44:17 +02:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-02-23 22:22:29 +01:00
|
|
|
platform: [linux, macos, windows]
|
2024-02-25 00:24:59 +01:00
|
|
|
arch: [x86_64, x86_32, universal]
|
2024-03-03 02:08:09 +01:00
|
|
|
godot-version: ["v4.2-stable", "v4.2.1-stable"]
|
2024-02-18 08:26:32 +01:00
|
|
|
exclude:
|
2024-02-25 00:24:59 +01:00
|
|
|
- platform: linux
|
|
|
|
arch: universal
|
2024-02-23 22:22:29 +01:00
|
|
|
- platform: macos
|
2024-02-25 00:24:59 +01:00
|
|
|
arch: x86_64
|
|
|
|
- platform: macos
|
|
|
|
arch: x86_32
|
|
|
|
- platform: windows
|
|
|
|
arch: universal
|
2024-02-13 03:22:16 +01:00
|
|
|
include:
|
|
|
|
- platform: linux
|
|
|
|
os: ubuntu-22.04
|
2024-02-23 22:22:29 +01:00
|
|
|
- platform: macos
|
|
|
|
os: macos-12
|
2024-02-13 03:22:16 +01:00
|
|
|
- platform: windows
|
|
|
|
os: windows-2022
|
2021-07-23 15:44:17 +02:00
|
|
|
steps:
|
2024-02-12 23:14:52 +01:00
|
|
|
- uses: actions/checkout@v4
|
2021-07-23 15:44:17 +02:00
|
|
|
- name: Setup Godot
|
2024-02-12 23:14:52 +01:00
|
|
|
uses: lihop/setup-godot@v2
|
2021-07-23 15:44:17 +02:00
|
|
|
with:
|
2024-03-30 08:25:38 +01:00
|
|
|
bits: ${{ matrix.arch == 'x86_32' && 32 || 64 }}
|
2024-03-03 02:08:09 +01:00
|
|
|
version: ${{ matrix.godot-version }}
|
2024-02-24 04:17:31 +01:00
|
|
|
- name: Macos setup
|
2024-02-25 01:13:13 +01:00
|
|
|
if: ${{ matrix.platform == 'macos' }}
|
2024-02-24 04:17:31 +01:00
|
|
|
run: |
|
|
|
|
# Some macos runners have metal which means we can use vulkan, others don't.
|
|
|
|
if system_profiler SPDisplaysDataType | grep -q "Metal"; then
|
|
|
|
echo RENDERING_DRIVER=vulkan >> .env
|
|
|
|
brew install molten-vk
|
|
|
|
else
|
|
|
|
echo RENDERING_DRIVER=opengl3 >> .env
|
|
|
|
fi
|
2024-02-24 03:48:48 +01:00
|
|
|
- name: Install just
|
|
|
|
uses: taiki-e/install-action@just
|
|
|
|
- name: Install dependencies
|
|
|
|
run: just install
|
|
|
|
- name: Import assets
|
|
|
|
shell: bash
|
|
|
|
run: godot --editor --headless --quit-after 100 || true
|
2023-01-25 20:30:17 +01:00
|
|
|
- name: Wait for build
|
2024-03-29 13:51:15 +01:00
|
|
|
uses: fountainhead/action-wait-for-check@v1.2.0
|
2023-01-25 20:01:02 +01:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2024-03-31 23:00:10 +02:00
|
|
|
checkName: "Build (${{ matrix.platform }}, ${{ matrix.arch }}, debug) #${{ github.run_number }}"
|
2023-01-25 20:01:02 +01:00
|
|
|
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
2024-02-13 09:23:22 +01:00
|
|
|
- name: Install binary build artifacts
|
2024-02-23 21:27:10 +01:00
|
|
|
uses: actions/download-artifact@v4
|
2023-01-25 19:39:06 +01:00
|
|
|
with:
|
2023-01-25 20:30:17 +01:00
|
|
|
path: addons/godot_xterm/native/bin
|
2024-02-24 04:24:54 +01:00
|
|
|
merge-multiple: true
|
2024-02-24 07:47:12 +01:00
|
|
|
- name: Set spawn-helper file permissions
|
|
|
|
if: ${{ matrix.platform == 'macos' }}
|
|
|
|
# File permissions are not preserved by upload-artifact.
|
|
|
|
run: chmod +x addons/godot_xterm/native/bin/spawn-helper
|
2024-02-17 23:50:38 +01:00
|
|
|
- name: Test
|
2024-02-18 08:26:32 +01:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2024-02-25 01:13:13 +01:00
|
|
|
if [ "${{ matrix.platform }}" = "windows" ]; then
|
2024-03-03 02:08:09 +01:00
|
|
|
just test | tee output.log
|
2024-02-18 08:26:32 +01:00
|
|
|
else
|
2024-03-03 02:08:09 +01:00
|
|
|
just test-all | tee output.log
|
|
|
|
fi
|
|
|
|
|
|
|
|
# This step often passes when it shouldn't, due to GUT not failing on script errors
|
|
|
|
# (see: https://github.com/bitwes/Gut/issues/210). Therefore, we check the output
|
|
|
|
# for expected (and unexpected) strings.
|
2024-03-03 09:14:00 +01:00
|
|
|
if grep -q 'SCRIPT_ERROR:' output.log || grep -q 'Tests none' output.log; then
|
2024-03-03 02:08:09 +01:00
|
|
|
exit 1
|
2024-02-18 08:26:32 +01:00
|
|
|
fi
|
2024-04-06 13:00:00 +02:00
|
|
|
- name: Upload screenshots
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: failed-screenshots
|
|
|
|
path: test/visual_regression/screenshots
|
2021-07-23 15:44:17 +02:00
|
|
|
|
2024-06-09 07:18:58 +02:00
|
|
|
benchmark:
|
|
|
|
name: Benchmark (${{matrix.benchmark}})
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
benchmark:
|
|
|
|
[
|
|
|
|
editor_launch,
|
|
|
|
cursor_motion,
|
|
|
|
dense_cells,
|
|
|
|
light_cells,
|
|
|
|
scrolling,
|
|
|
|
scrolling_bottom_region,
|
|
|
|
scrolling_bottom_small_region,
|
|
|
|
scrolling_fullscreen,
|
|
|
|
scrolling_top_region,
|
|
|
|
scrolling_top_small_region,
|
|
|
|
unicode,
|
|
|
|
]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
- name: Setup Godot
|
|
|
|
uses: lihop/setup-godot@v2
|
|
|
|
with:
|
|
|
|
version: "4.2.2-stable"
|
|
|
|
- name: Install just
|
|
|
|
uses: taiki-e/install-action@just
|
|
|
|
- name: Update gdextension file
|
|
|
|
run: | # Use release builds as the build job finishes sooner.
|
|
|
|
sed -i 's/template_debug/template_release/g' addons/godot_xterm/native/godot-xterm.gdextension
|
|
|
|
- name: Import assets
|
|
|
|
shell: bash
|
|
|
|
run: godot --editor --headless --quit-after 100 || true
|
|
|
|
- name: Wait for build
|
|
|
|
uses: fountainhead/action-wait-for-check@v1.2.0
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
checkName: "Build (linux, x86_64, release) #${{ github.run_number }}"
|
|
|
|
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
|
|
- name: Install binary build artifacts
|
|
|
|
uses: actions/download-artifact@v4
|
|
|
|
with:
|
|
|
|
path: addons/godot_xterm/native/bin
|
|
|
|
merge-multiple: true
|
|
|
|
- name: Benchmark
|
|
|
|
shell: bash
|
|
|
|
run: just bench ${{matrix.benchmark}}
|
|
|
|
- name: Upload results
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: benchmark-results-${{ matrix.benchmark }}
|
|
|
|
path: benchmark/results/*.json
|
|
|
|
|
|
|
|
process-benchmarks:
|
|
|
|
name: Process Benchmarks
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [benchmark]
|
|
|
|
permissions:
|
|
|
|
deployments: write
|
|
|
|
contents: write
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/upload-artifact/merge@v4
|
|
|
|
with:
|
|
|
|
name: benchmark-results
|
|
|
|
pattern: "benchmark-results-*"
|
|
|
|
delete-merged: true
|
|
|
|
- uses: actions/download-artifact@v4
|
|
|
|
with:
|
|
|
|
name: benchmark-results
|
|
|
|
path: benchmark/results/
|
|
|
|
- name: Merge results
|
|
|
|
run: jq -s '[.[][]]' benchmark/results/*.json > benchmark/results/all.json
|
|
|
|
- name: Download previous benchmark data
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: ./cache
|
|
|
|
key: ${{runner.os}}-benchmark
|
|
|
|
- name: Store benchmark result
|
|
|
|
uses: benchmark-action/github-action-benchmark@v1
|
|
|
|
if: github.ref != 'refs/heads/main'
|
|
|
|
with:
|
|
|
|
tool: "customSmallerIsBetter"
|
|
|
|
output-file-path: benchmark/results/all.json
|
|
|
|
external-data-json-path: ./cache/benchmark-data.json
|
|
|
|
alert-threshold: "20%"
|
|
|
|
fail-threshold: "200%"
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
comment-on-alert: true
|
|
|
|
summary-always: true
|
|
|
|
- name: Publish benchmark results
|
|
|
|
if: github.ref == 'refs/heads/main'
|
|
|
|
uses: benchmark-action/github-action-benchmark@v1
|
|
|
|
with:
|
|
|
|
name: "GodotXterm Benchmarks"
|
|
|
|
tool: "customSmallerIsBetter"
|
|
|
|
output-file-path: benchmark/results/all.json
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
gh-pages-branch: stable
|
|
|
|
benchmark-data-dir-path: docs/dev/bench
|
|
|
|
auto-push: true
|
|
|
|
|
2024-02-23 21:27:10 +01:00
|
|
|
merge-artifacts:
|
|
|
|
name: Merge Artifacts
|
|
|
|
runs-on: ubuntu-latest
|
2024-03-30 03:24:32 +01:00
|
|
|
needs: [build-linux, build-other-platforms, test, web-export]
|
2024-02-23 21:27:10 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
target: [release, debug]
|
|
|
|
steps:
|
|
|
|
- uses: actions/upload-artifact/merge@v4
|
|
|
|
with:
|
|
|
|
name: libgodot-xterm-${{ matrix.target }}
|
|
|
|
pattern: "*-${{ matrix.target }}"
|
|
|
|
delete-merged: true
|
|
|
|
|
2021-07-18 19:27:25 +02:00
|
|
|
# Git archive should only include addons/godot_xterm directory.
|
|
|
|
check-archive:
|
2024-02-12 22:50:19 +01:00
|
|
|
name: "Check Archive"
|
2022-08-27 10:32:03 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2021-07-18 19:27:25 +02:00
|
|
|
steps:
|
2024-02-12 23:14:52 +01:00
|
|
|
- uses: actions/checkout@v4
|
2024-02-12 22:50:19 +01:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
- name: Create git archive
|
|
|
|
run: git archive -o archive.zip HEAD
|
|
|
|
- name: Extract archive
|
|
|
|
run: mkdir -p /tmp/unzipped && unzip archive.zip -d /tmp/unzipped
|
|
|
|
- name: Check that archive only contains addons/godot_xterm directory
|
|
|
|
run: |
|
|
|
|
shopt -s nullglob dotglob
|
2024-02-12 23:10:14 +01:00
|
|
|
ls -laR /tmp/unzipped
|
2024-02-12 22:50:19 +01:00
|
|
|
files=(/tmp/unzipped/*)
|
|
|
|
if [ ${#files[@]} -ne 1 ]; then
|
|
|
|
echo "Wrong number of files in archive (${#files[@]}) expected 1."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [ ! -d "/tmp/unzipped/addons" ]; then
|
|
|
|
echo "Expected directory (addons) not found."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
files=(/tmp/unzipped/addons)
|
|
|
|
if [ ${#files[@]} -ne 1 ]; then
|
|
|
|
echo "Wrong number of files in addons directory (${#files[@]}) expected 1."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [ ! -d "/tmp/unzipped/addons/godot_xterm" ]; then
|
|
|
|
echo "Expected directory (addons/godot_xterm) not found."
|
|
|
|
exit 1
|
|
|
|
fi
|
2021-07-20 02:27:07 +02:00
|
|
|
|
2024-02-12 23:27:07 +01:00
|
|
|
check-pre-commit:
|
|
|
|
name: "Check Pre-Commit"
|
2022-08-27 10:32:03 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2022-04-23 10:49:39 +02:00
|
|
|
steps:
|
2024-02-12 23:14:52 +01:00
|
|
|
- uses: actions/checkout@v4
|
2024-02-12 23:27:07 +01:00
|
|
|
- uses: pre-commit/action@v3.0.1
|