CI: source-regressions.yml is valid again after the dev merge (runner kept, dev's new tests in), and four game-free tests fixed #760

Merged
hckrman101 merged 2 commits from ci-fix-after-dev-merge into main 2026-11-08 20:21:13 +00:00
hckrman101 commented 2026-11-08 20:15:37 +00:00 (Migrated from github.com)

What broke

.github/workflows/source-regressions.yml on main is not a valid workflow.

The merge of #695 (2ca03169) brought the dev side's per-test workflow back around the runner job, with both of its path lists. That left two pull_request: keys under on:, and GitHub rejects the file. Every push to main since then shows "workflow file issue" with 0 jobs, and pull requests get no source checks at all.

actionlint, which the same workflow would run, reports:

source-regressions.yml:362:5: key "branches" is duplicated in "pull_request" section
source-regressions.yml:363:3: key "pull_request" is duplicated in "on" section

The fix

The file is the runner workflow again, with the parts worth keeping from each side.

From #695:

  • tests/run_all.py runs every test file in one step, so all of them run even when one fails.
  • The table in the run's summary.
  • --strict.
  • The Windows native step (cl.exe present_rect and test_invalidate_vcore.py --cxx cl) and the Builder steps.
  • The SPIR-V global16 job and actionlint.

From the dev side and main since:

  • The action pins Dependabot moved: checkout v7.0.1, setup-python v7.1.0, setup-dotnet v6.1.0.
  • dev as a trigger: pushes to main or dev and pull requests to either start the source checks, as the dev side's workflow did. The Windows builder now also runs on pushes to dev, like the AppImage already does.
  • The tests dev added, all run by the runner without being listed: test_bound_keys, test_build_log, test_builder_python, test_check_no_compiler, test_draw_binds, test_env_file, test_gpu_choice, test_mouse_native, test_mouse_settings, test_nvn_buffer_map, test_vk_swapchain_compat.
  • test_nvn_buffer_map keeps the --cc gcc the dev list gave it, as an entry in the runner's ARGS. No other new arguments, installs or jobs came with the dev list.

Test fixes

These checks were failing (the coordinator saw them on a PR run from current main). All the causes were in the tests, none in the game's code:

  • test_cpp_preflight (both systems): the build's compiler check takes toolchain.find()'s answer only when it is a file. The test's fake toolchain answered the bare --cxx g++, so the check said "no C compiler was found" before reaching the library check the test is about. The test now passes the compiler's full path.
  • test_chunk_split: it used Path.read_text(newline=...), which is new in Python 3.13. CI runs 3.12, the builder's own Python. It now reads with open(newline="").
  • test_bound_keys (Windows): the fixture built the executable's path with a forward slash. nn_hid.c looks for a backslash first, as a Windows path has, so it found the folder above and missed the test's hookshot_options.ini. The fixture now uses the system's separator.
  • test_env_file (Windows): the fixture called setenv and unsetenv, which Windows lacks. It now has its own versions built on _putenv, which is what the game uses there.

Fork runs

Locally: actionlint is clean, and tests/run_all.py --strict passes 102 checks with 4 skipped (the game- and GPU-only ones).

## What broke `.github/workflows/source-regressions.yml` on `main` is not a valid workflow. The merge of #695 (`2ca03169`) brought the dev side's per-test workflow back around the runner job, with both of its path lists. That left two `pull_request:` keys under `on:`, and GitHub rejects the file. Every push to `main` since then shows "workflow file issue" with **0 jobs**, and pull requests get no source checks at all. actionlint, which the same workflow would run, reports: ``` source-regressions.yml:362:5: key "branches" is duplicated in "pull_request" section source-regressions.yml:363:3: key "pull_request" is duplicated in "on" section ``` ## The fix The file is the runner workflow again, with the parts worth keeping from each side. **From #695:** - `tests/run_all.py` runs every test file in one step, so all of them run even when one fails. - The table in the run's summary. - `--strict`. - The Windows native step (`cl.exe` present_rect and `test_invalidate_vcore.py --cxx cl`) and the Builder steps. - The SPIR-V global16 job and actionlint. **From the dev side and `main` since:** - The action pins Dependabot moved: checkout v7.0.1, setup-python v7.1.0, setup-dotnet v6.1.0. - `dev` as a trigger: pushes to `main` or `dev` and pull requests to either start the source checks, as the dev side's workflow did. The Windows builder now also runs on pushes to `dev`, like the AppImage already does. - The tests dev added, all run by the runner without being listed: `test_bound_keys`, `test_build_log`, `test_builder_python`, `test_check_no_compiler`, `test_draw_binds`, `test_env_file`, `test_gpu_choice`, `test_mouse_native`, `test_mouse_settings`, `test_nvn_buffer_map`, `test_vk_swapchain_compat`. - `test_nvn_buffer_map` keeps the `--cc gcc` the dev list gave it, as an entry in the runner's `ARGS`. No other new arguments, installs or jobs came with the dev list. ## Test fixes These checks were failing (the coordinator saw them on a PR run from current main). All the causes were in the tests, none in the game's code: - **`test_cpp_preflight`** (both systems): the build's compiler check takes `toolchain.find()`'s answer only when it is a file. The test's fake toolchain answered the bare `--cxx g++`, so the check said "no C compiler was found" before reaching the library check the test is about. The test now passes the compiler's full path. - **`test_chunk_split`**: it used `Path.read_text(newline=...)`, which is new in Python 3.13. CI runs 3.12, the builder's own Python. It now reads with `open(newline="")`. - **`test_bound_keys`** (Windows): the fixture built the executable's path with a forward slash. `nn_hid.c` looks for a backslash first, as a Windows path has, so it found the folder above and missed the test's `hookshot_options.ini`. The fixture now uses the system's separator. - **`test_env_file`** (Windows): the fixture called `setenv` and `unsetenv`, which Windows lacks. It now has its own versions built on `_putenv`, which is what the game uses there. ## Fork runs - Pushing current `main` to the fork reproduces the failure: https://github.com/hckrman101/Hookshot/actions/runs/42518223091 (0 jobs). - Source checks (manual run): https://github.com/hckrman101/Hookshot/actions/runs/42518222969 - Linux: 102 passed, 0 failed, 4 skipped - Windows: 96 passed, 0 failed, 10 skipped - Pull-request runs (into a copy of `dev` on the fork), all green: - Source checks: https://github.com/hckrman101/Hookshot/actions/runs/42518230047 - Windows builder: https://github.com/hckrman101/Hookshot/actions/runs/42518230046 - Linux AppImage: https://github.com/hckrman101/Hookshot/actions/runs/42518230048 Locally: actionlint is clean, and `tests/run_all.py --strict` passes 102 checks with 4 skipped (the game- and GPU-only ones).
klimovich008 commented 2026-11-08 20:20:25 +00:00 (Migrated from github.com)

Independent check of source-regressions.yml with the official actionlint 1.7.12 Windows binary:

  • The workflow on main and #758 is byte-identical and fails with duplicate branches and pull_request keys.
  • The complete workflow at this PR's current head passes. Fails on the old code, passes now.

Command: actionlint -shellcheck= -pyflakes= source-regressions.yml. Those flags disable only the optional external analyzers; workflow and expression checks remain enabled. The downloaded binary matched both the release digest and published checksum.

This check covers this workflow file, not the other changes in the PR. It also explains the missing source-check run on #758.

Independent check of `source-regressions.yml` with the official actionlint 1.7.12 Windows binary: - The workflow on main and #758 is byte-identical and fails with duplicate `branches` and `pull_request` keys. - The complete workflow at this PR's current head passes. Fails on the old code, passes now. Command: `actionlint -shellcheck= -pyflakes= source-regressions.yml`. Those flags disable only the optional external analyzers; workflow and expression checks remain enabled. The downloaded binary matched both the release digest and published checksum. This check covers this workflow file, not the other changes in the PR. It also explains the missing source-check run on #758.
Commenting is not possible because the repository is archived.
No description provided.