Build only libuv on windows #1895
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build and Test" | |
on: | |
push: | |
schedule: # Build and test daily. | |
- cron: 0 11 * * * | |
jobs: | |
import-assets: | |
if: false | |
name: "Import Assets" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [linux, macos, windows] | |
include: | |
- platform: linux | |
os: ubuntu-22.04 | |
- platform: macos | |
os: macos-12 | |
- platform: windows | |
os: windows-2022 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Import assets | |
uses: ./.github/actions/import-assets | |
with: | |
godot-version: v4.2.1-stable | |
- name: Upload imports | |
uses: actions/upload-artifact@v3 | |
with: | |
name: imports-${{ matrix.platform }} | |
path: .godot/ | |
build-linux: | |
if: false | |
name: Build (linux, ${{ matrix.arch }}, ${{ matrix.target }}) | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [x86_64, x86_32] | |
target: [release, debug] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Cache submodules | |
uses: ./.github/actions/cache-submodules | |
id: cache-submodules | |
with: | |
platform: linux | |
arch: ${{ matrix.arch }} | |
target: ${{ matrix.target }} | |
- name: Pull docker images | |
run: docker-compose pull | |
working-directory: addons/godot_xterm/native | |
- name: Cache docker image layers | |
uses: jpribyl/[email protected] | |
continue-on-error: true | |
- name: Ensure scons cache exists | |
run: mkdir -p ${{github.workspace}}/.scons-cache | |
- name: Build libuv | |
if: steps.cache-submodules.outputs.cache-hit != 'true' | |
working-directory: addons/godot_xterm/native | |
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 | |
- name: Build libgodot-xterm | |
working-directory: addons/godot_xterm/native | |
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 | |
- name: Upload binaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: libgodot-xterm-${{ matrix.target }} | |
path: | | |
addons/godot_xterm/native/bin/*.so | |
build-other-platforms: | |
name: Build (${{ matrix.platform }}, ${{ matrix.arch }}, ${{ matrix.target}}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [windows] | |
target: [release, debug] | |
bits: [64, 32] | |
include: | |
- platform: windows | |
os: windows-2022 | |
- platform: windows | |
bits: 64 | |
arch: x86_64 | |
- platform: windows | |
bits: 32 | |
arch: x86_32 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup MSVC command prompt | |
uses: ilammy/msvc-dev-cmd@v1 | |
if: ${{ matrix.platform == 'windows' }} | |
with: | |
arch: win${{ matrix.bits }} | |
- name: Setup cmake | |
uses: jwlawson/actions-setup-cmake@v2 | |
with: | |
cmake-version: "3.23.2" | |
use-32bit: ${{ matrix.bits == 32 && matrix.platform == 'windows' }} | |
- name: Build and test libuv | |
working-directory: addons/godot_xterm/native/thirdparty/libuv | |
shell: bash | |
run: | | |
mkdir -p build | |
(cd build && cmake .. \ | |
-DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON \ | |
-DCMAKE_C_FLAGS_RELEASE="/MT" -DCMAKE_C_FLAGS_DEBUG="/MTd") | |
cmake --build build --config ${{ matrix.target }} -j2 | |
build/uv_run_tests_a | |
html5-export: | |
if: false # Temporarily disabled. | |
name: "HTML5 Export" | |
needs: [build-linux] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Godot | |
uses: lihop/setup-godot@v2 | |
with: | |
export-templates: true | |
- name: Install binary build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: libgodot-xterm-release | |
path: addons/godot_xterm/native/bin | |
- name: Import assets | |
uses: ./.github/actions/import-assets | |
- name: Export HTML5 | |
uses: nick-fields/retry@v3 | |
with: | |
command: godot --no-window --export HTML5 | |
retry_on: error | |
timeout_minutes: 5 | |
max_attempts: 6 | |
- name: NPM cache | |
uses: c-hive/gha-npm-cache@v1 | |
with: | |
directory: test/html5 | |
- name: Smoke test HTML5 export | |
shell: bash | |
working-directory: test/html5 | |
run: | | |
npm ci | |
npx serve ../../docs/demo -p 3000 & | |
npx cypress run | |
- name: Upload cypress artifacts (on failure) | |
uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: cypress-artifacts | |
path: |- | |
test/html5/cypress/screenshots | |
test/html5/cypress/videos | |
- name: Upload export | |
uses: actions/upload-artifact@v3 | |
with: | |
name: html5-demo | |
path: docs/demo | |
test: | |
name: Test (${{ matrix.test-type }}, ${{ matrix.platform }}, ${{ matrix.arch }}, debug) | |
needs: [check-archive, check-pre-commit] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [linux, windows] # Testing not currently supported on macOS. | |
bits: [64, 32] | |
test-type: [headless, rendering, unix] | |
exclude: | |
- platform: windows | |
test-type: rendering | |
- platform: windows | |
test-type: unix | |
include: | |
- platform: linux | |
os: ubuntu-22.04 | |
- platform: windows | |
os: windows-2022 | |
- platform: linux | |
bits: 64 | |
arch: x86_64 | |
- platform: linux | |
bits: 32 | |
arch: x86_32 | |
- platform: windows | |
bits: 64 | |
arch: x86_64 | |
- platform: windows | |
bits: 32 | |
arch: x86_32 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Godot | |
uses: lihop/setup-godot@v2 | |
with: | |
version: "4.2.1-stable" | |
- uses: taiki-e/install-action@just | |
- run: just install | |
- name: Wait for asset import | |
uses: fountainhead/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
checkName: Import Assets (${{ matrix.platform }}) | |
ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
- name: Download imports | |
uses: actions/download-artifact@v3 | |
with: | |
name: imports-${{ matrix.platform }} | |
path: .godot | |
- name: Wait for build | |
uses: fountainhead/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
checkName: Build (${{ matrix.platform }}, ${{ matrix.arch }}, debug) | |
ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
- name: Install binary build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: libgodot-xterm-debug | |
path: addons/godot_xterm/native/bin | |
- name: Test | |
shell: bash | |
run: | | |
if [ "${{ matrix.test-type }}" = "headless" ]; then | |
just test | |
else | |
just test-${{ matrix.test-type }} | |
fi | |
delete-asset-imports: | |
name: Delete Asset Imports | |
runs-on: ubuntu-22.04 | |
needs: [import-assets, test] | |
steps: | |
- uses: geekyeggo/delete-artifact@v2 | |
with: | |
name: imports-* | |
# Git archive should only include addons/godot_xterm directory. | |
check-archive: | |
if: false | |
name: "Check Archive" | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
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 | |
ls -laR /tmp/unzipped | |
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 | |
check-pre-commit: | |
if: false | |
name: "Check Pre-Commit" | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pre-commit/[email protected] |