Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ updates:
directory: /
schedule:
interval: weekly
cooldown:
default-days: 7
groups:
actions:
patterns: ["*"]
Expand All @@ -17,6 +19,8 @@ updates:
directory: /
schedule:
interval: weekly
cooldown:
default-days: 7
commit-message:
prefix: deps
open-pull-requests-limit: 1
196 changes: 52 additions & 144 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ name: CI
on:
push:
branches: [main]
# Docs-only merges already ran all documentation tests on their pull request and are excluded here so they
# neither waste runner slots nor coalesce/cancel a pending code push in ci-push-refs/heads/main.
paths-ignore:
- "README.md"
- "CONTRIBUTING.md"
- "AGENTS.md"
- "docs/**/*.md"
pull_request:
workflow_dispatch:
# One independent default-branch snapshot daily, not a full run for every queued merge.
Expand Down Expand Up @@ -34,21 +41,26 @@ jobs:
persist-credentials: false
- name: Check whether only documentation changed
id: paths
shell: pwsh
shell: bash
run: |
# A pull_request checkout is the test merge; its first parent is the PR base.
# Treat missing history, an empty diff, and renames out of code conservatively.
$PSNativeCommandUseErrorActionPreference = $false
$docsOnly = $false
git diff --quiet "$env:GITHUB_SHA^1" "$env:GITHUB_SHA" --
if ($LASTEXITCODE -eq 1) {
git diff --quiet --no-renames "$env:GITHUB_SHA^1" "$env:GITHUB_SHA" -- . `
':(exclude,top)README.md' ':(exclude,top)CONTRIBUTING.md' `
':(exclude,top)AGENTS.md' ':(exclude,top,glob)docs/**/*.md'
$docsOnly = $LASTEXITCODE -eq 0
}
"docs-only=$($docsOnly.ToString().ToLowerInvariant())" >> $env:GITHUB_OUTPUT
exit 0 # GitHub's pwsh wrapper would otherwise forward git diff's status.
docs_only=false
base="${GITHUB_SHA}^1"
if git rev-parse --verify -q "${base}^{commit}" >/dev/null 2>&1; then
diff_rc=0
git diff --quiet "$base" "$GITHUB_SHA" -- || diff_rc=$?
if [ "$diff_rc" -eq 1 ]; then
code_rc=0
git diff --quiet --no-renames "$base" "$GITHUB_SHA" -- . \
':(exclude,top)README.md' ':(exclude,top)CONTRIBUTING.md' \
':(exclude,top)AGENTS.md' ':(exclude,top,glob)docs/**/*.md' || code_rc=$?
if [ "$code_rc" -eq 0 ]; then
docs_only=true
fi
fi
fi
echo "docs-only=$docs_only" >> "$GITHUB_OUTPUT"
# A docs-only diff still needs the tests that read those documents, because `check` is skipped for it: every
# tests/test_docs_*.py (links, the design.md contract rows, list items, the repository paths a document
# names) and the i18n index, which checks docs/i18n/README.md. All are standard library only and read only
Expand Down Expand Up @@ -96,14 +108,14 @@ jobs:
- name: Tests (standard library only, no game data)
shell: bash
run: |
# Keep the pytest selection predicate, but run the selected files two at a time.
# Keep the pytest selection predicate, but run the selected files four at a time.
# The runner reports every failure instead of stopping at the first one.
while IFS= read -r t; do
if grep -Eq "$PYTEST_FILE_MARKERS" "$t" || ! grep -q '__main__' "$t"; then
continue
fi
printf '%s\n' "$t"
done < <(find tests -path 'tests/semantic' -prune -o -type f -name 'test_*.py' -print | LC_ALL=C sort) | python -I scripts/run_standalone_tests.py -j 2
done < <(find tests -path 'tests/semantic' -prune -o -type f -name 'test_*.py' -print | LC_ALL=C sort) | python -I scripts/run_standalone_tests.py -j 4
- name: Build rpf9dump
run: dotnet build tools/rpf9dump/rpf9dump.csproj -c Release
- name: Test TTPF export retry
Expand All @@ -127,7 +139,11 @@ jobs:
python -I tests/test_ttpf_assets.py
- name: Test rpf9dump diagnostics
run: dotnet run --project tests/Rpf9DumpDiagnostics/Rpf9DumpDiagnostics.csproj -c Release
translator-tests:

# Consolidated Linux job: viewer streaming tests, pytest translator/numpy tests, and the Linux standard-library
# test loop (with SPIRV-Tools, LLVM 21, and numpy installed so spirv-val checks, numpy paths, and POSIX-only
# tests that skip on Windows run here).
linux-python-and-viewer:
needs: change-scope
if: ${{ !cancelled() && needs.change-scope.outputs.docs-only != 'true' }}
runs-on: ubuntu-24.04
Expand All @@ -141,7 +157,12 @@ jobs:
python-version: "3.12"
cache: "pip"
cache-dependency-path: tests/requirements.txt
- name: Install llvm-mc (LLVM 21) and spirv-tools
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "24"
- name: Viewer chunk streaming (synthetic, no browser or game data)
run: node --test tests/test_*.cjs
- name: Install llvm-mc (LLVM 21), SPIRV-Tools and Python test dependencies
shell: bash
run: |
# The signing key is checked against apt.llvm.org's published fingerprint before apt trusts it.
Expand Down Expand Up @@ -171,153 +192,40 @@ jobs:
fi
done < <(find tests -path 'tests/semantic' -prune -o -type f -name 'test_*.py' -print | LC_ALL=C sort)
python -m pytest "${pytest_files[@]}" -q
semantic-tests:
needs: change-scope
if: ${{ !cancelled() && needs.change-scope.outputs.docs-only != 'true' }}
runs-on: ${{ matrix.os }}
# The Windows leg does not fit in 10 minutes. On windows-latest, 14 of 23 runs on 24 November 2026 were cancelled
# at 10, each time with test_mutations.py the only file still running (250-381 s there, 25-42 s on Linux), and the
# 9 that finished spent 374-577 s in the test step. The Linux leg, the one pull requests run, takes 3-5 minutes.
timeout-minutes: ${{ matrix.os == 'windows-latest' && 20 || 10 }}
strategy:
matrix:
# Pull requests run the Linux leg only: in 914 sampled pull request runs the Windows leg never failed while the
# Linux leg passed, and it took about 14% of the account's runner time. Pushes to main and workflow_dispatch
# run both legs.
os: ${{ fromJSON(github.event_name == 'pull_request' && '["ubuntu-latest"]' || '["windows-latest", "ubuntu-latest"]') }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.12"
# Some semantic tests assemble and validate the translator's output with spirv-as / spirv-val and skip without
# them (test_fma_khr, test_bary_fallback, test_image_coherent...). The runner images have neither, so a skip
# here reads as a pass. The Linux leg installs SPIRV-Tools and LEONIDA_REQUIRE_SPIRV_TOOLS=1 makes
# tests/semantic/test_spirv_tools_required.py fail when they are missing, so those tests cannot go quiet again.
# The Windows leg has no SPIRV-Tools and still skips them.
- name: Install SPIRV-Tools
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends spirv-tools
spirv-as --version
spirv-val --version
- name: Translator semantic tests
env:
LEONIDA_REQUIRE_SPIRV_TOOLS: ${{ runner.os == 'Linux' && '1' || '0' }}
run: python -I scripts/run_semantic_tests.py tests/semantic -v

# The Python suites on an Apple Silicon Mac: the standard-library loop of the check job, the translator semantic
# tests and the pytest files of the translator-tests job, with Homebrew's llvm-mc and SPIRV-Tools. macos-26, not
# macos-15: the Homebrew bottles cover Sequoia and later, but the runtime needs Xcode 26's libc++ (runtime.yml).
macos-python:
needs: change-scope
if: ${{ !cancelled() && needs.change-scope.outputs.docs-only != 'true' }}
runs-on: macos-26
timeout-minutes: 20
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
HOMEBREW_NO_INSTALL_CLEANUP: "1"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: tests/requirements.txt
- name: Python tools compile
run: python -m compileall -q make_game.py tools tests
- name: make_game.py help
run: python -I make_game.py --help
# Before anything is installed, as in the check job, so these files stay standard library only. The semantic
# suite runs alongside the loop, on another of the runner's three cores; together they take about 6 minutes.
- name: Translator semantic tests and tests (standard library only, no game data)
- name: Tests (standard library only, Linux)
shell: bash
run: |
python -m unittest discover -s tests/semantic > "$RUNNER_TEMP/semantic.log" 2>&1 &
semantic=$!
while IFS= read -r t; do
if grep -Eq "$PYTEST_FILE_MARKERS" "$t" || ! grep -q '__main__' "$t"; then
continue
fi
echo "== $t"
python -I "$t" || exit 1
done < <(find tests -path 'tests/semantic' -prune -o -type f -name 'test_*.py' -print | LC_ALL=C sort)
status=0
wait "$semantic" || status=$?
echo "== tests/semantic"
cat "$RUNNER_TEMP/semantic.log"
exit "$status"
- name: Install llvm-mc and SPIRV-Tools
run: |
brew install llvm spirv-tools
pip install -r tests/requirements.txt
LLVM_MC="$(brew --prefix llvm)/bin/llvm-mc" # keg-only: not on PATH
echo "LLVM_MC=$LLVM_MC" >> "$GITHUB_ENV"
"$LLVM_MC" --version | grep -E 'LLVM version|amdgcn'
- name: Translator tests (pytest)
shell: bash
run: |
pytest_files=()
while IFS= read -r t; do
if grep -Eq "$PYTEST_FILE_MARKERS" "$t" || ! grep -q '__main__' "$t"; then
pytest_files+=("$t")
elif [[ "$t" == tests/test_tex_headers.py ]]; then
pytest_files+=("$t::TestTextureDescriptorParsing::test_stdlib_qword_scanner_edge_cases_and_parity")
fi
done < <(find tests -path 'tests/semantic' -prune -o -type f -name 'test_*.py' -print | LC_ALL=C sort)
python -m pytest "${pytest_files[@]}" -q
printf '%s\n' "$t"
done < <(find tests -path 'tests/semantic' -prune -o -type f -name 'test_*.py' -print | LC_ALL=C sort) | python -I scripts/run_standalone_tests.py -j 4

viewer-tests:
semantic-tests:
needs: change-scope
if: ${{ !cancelled() && needs.change-scope.outputs.docs-only != 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "24"
- name: Viewer chunk streaming (synthetic, no browser or game data)
run: node --test tests/test_*.cjs

# The check job runs the standard-library loop on Windows, which has no SPIRV-Tools or numpy: the spirv-val checks
# (test_split_big_switch, test_image_load_typed...), the numpy paths and the POSIX-only tests skip there. This job
# runs the same loop on Linux with them installed, so those tests run somewhere.
stdlib-tests-linux:
needs: change-scope
if: ${{ !cancelled() && needs.change-scope.outputs.docs-only != 'true' }}
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: tests/requirements.txt
- name: Install SPIRV-Tools and numpy
# Some semantic tests assemble and validate the translator's output with spirv-as / spirv-val and skip without
# them (test_fma_khr, test_bary_fallback, test_image_coherent...). The runner image has neither, so a skip
# here reads as a pass. Installing SPIRV-Tools and setting LEONIDA_REQUIRE_SPIRV_TOOLS=1 makes
# tests/semantic/test_spirv_tools_required.py fail when they are missing, so those tests cannot go quiet again.
- name: Install SPIRV-Tools
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends spirv-tools
pip install -r tests/requirements.txt
- name: Tests (standard library only, Linux)
shell: bash
run: |
while IFS= read -r t; do
if grep -Eq "$PYTEST_FILE_MARKERS" "$t" || ! grep -q '__main__' "$t"; then
continue
fi
echo "== $t"
python -I "$t" || exit 1
done < <(find tests -path 'tests/semantic' -prune -o -type f -name 'test_*.py' -print | LC_ALL=C sort)
spirv-as --version
spirv-val --version
- name: Translator semantic tests
env:
LEONIDA_REQUIRE_SPIRV_TOOLS: "1"
run: python -I scripts/run_semantic_tests.py tests/semantic -v
6 changes: 3 additions & 3 deletions .github/workflows/jactionlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# `correctness` checks workflow syntax, expressions, shellcheck, and dependabot.yml;
# switch to `default` once all workflows declare timeouts and concurrency.
# `default` checks workflow syntax, expressions, shellcheck, dependabot.yml,
# pinned actions, permissions, timeouts, and concurrency.
- uses: jdx/jactionlint@72c00452809bcca05b8bc12acdcf15dd7a9c1c5e # v2.6.0
with:
profile: correctness
profile: default
18 changes: 17 additions & 1 deletion .github/workflows/launcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
# Windows first, as the project is; Linux for Wayland and X11 users and the same tests on another system.
os: [windows-latest, ubuntu-24.04]
runs-on: ${{ matrix.os }}
timeout-minutes: 40
timeout-minutes: 20
defaults:
run:
working-directory: launcher/native
Expand All @@ -47,11 +47,27 @@ jobs:
persist-credentials: false
# The runners' own rustup, no third-party action: the stable toolchain with its formatter and linter.
- name: Rust toolchain
id: rust-toolchain
run: |
rustup toolchain install stable --profile minimal --component clippy,rustfmt
rustup default stable
rustc_hash=$(rustc -vV | tr -d '\r' | awk '/^commit-hash: /{print $2}')
test -n "$rustc_hash"
echo "rustc-hash=$rustc_hash" >> "$GITHUB_OUTPUT"
rustc --version
- name: Cache Cargo dependencies and build
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.cargo/registry
~/.cargo/git
launcher/native/target
key: launcher-cargo-${{ runner.os }}-${{ steps.rust-toolchain.outputs.rustc-hash }}-${{ hashFiles('launcher/native/Cargo.lock') }}
restore-keys: |
launcher-cargo-${{ runner.os }}-${{ steps.rust-toolchain.outputs.rustc-hash }}-
launcher-cargo-${{ runner.os }}-
- name: Format
if: matrix.os == 'ubuntu-24.04'
run: cargo fmt --check
- name: Lints
run: cargo clippy --locked --all-targets -- -D warnings
Expand Down
Loading
Loading