Skip to content

ci: extract inline CI python scripts into .github/scripts#107

Draft
dannywillems wants to merge 1 commit into
mainfrom
refactor/extract-rpc-test-runner
Draft

ci: extract inline CI python scripts into .github/scripts#107
dannywillems wants to merge 1 commit into
mainfrom
refactor/extract-rpc-test-runner

Conversation

@dannywillems

@dannywillems dannywillems commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

The CI workflows wrote three different Python programs to ./subclass.py via heredocs and ran them inline. Move each into its own checked-in file under .github/scripts so they can be read, linted, and tested directly:

  • run_rpc_tests.py: subclasses rpc-tests.RPCTestHandler and runs a shard's tests (from the "RPC test" job in ci.yml).
  • set_rpc_test_shards.py: assigns RPC tests to shards and prints the shard matrix JSON (from the "set-rpc-tests" job in ci.yml).
  • check_no_ci_required.py: reads changed paths from stdin and decides whether CI can be skipped (from the "no-ci-required" job in ci-skip.yml).

GitHub Actions expressions that were interpolated inside the Python are now passed through the environment instead: matrix.file_ext via EXEEXT and matrix.rpc_tests via RPC_TESTS (parsed with json.loads). The other scripts already took input from the environment or stdin, so their interfaces are unchanged. Script bodies are otherwise identical.

Closes #112.

The CI workflows wrote three different Python programs to ./subclass.py
via heredocs and ran them inline. Move each into its own checked-in file
under .github/scripts so they can be read, linted, and tested directly:

- run_rpc_tests.py: subclasses rpc-tests.RPCTestHandler and runs a
  shard's tests (from the "RPC test" job in ci.yml).
- set_rpc_test_shards.py: assigns RPC tests to shards and prints the
  shard matrix JSON (from the "set-rpc-tests" job in ci.yml).
- check_no_ci_required.py: reads changed paths from stdin and decides
  whether CI can be skipped (from the "no-ci-required" job in
  ci-skip.yml).

GitHub Actions expressions that were interpolated inside the Python are
now passed through the environment instead: matrix.file_ext via EXEEXT
and matrix.rpc_tests via RPC_TESTS (parsed with json.loads). The other
scripts already took input from the environment or stdin, so their
interfaces are unchanged. Script bodies are otherwise identical.
@dannywillems dannywillems marked this pull request as draft June 5, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extract inline CI Python scripts into .github/scripts

1 participant