Skip to content

Add a compile-check test and CI workflow#89

Open
tomjn wants to merge 1 commit into
Yaribz:masterfrom
tomjn:feature/ci-compile-check
Open

Add a compile-check test and CI workflow#89
tomjn wants to merge 1 commit into
Yaribz:masterfrom
tomjn:feature/ci-compile-check

Conversation

@tomjn

@tomjn tomjn commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What

Adds the first automated check to the repository:

  • t/00-compile.t runs perl -c on every source under src/. The sibling
    modules (SimpleLog, SimpleEvent, SpringLobbyInterface,
    SpringAutoHostInterface, SpringLobbyProtocol) are fetched at install time
    and not vendored here, so the test generates minimal stubs for them, just
    enough for a compile check.
  • .github/workflows/compile.yml runs the test via prove on push and pull
    request, using only core Perl modules (no dependency installation needed).

Why

There is currently no automated test of any kind. This is the cheapest possible
regression net: it catches parse/compile errors, lexical-scope mistakes, and
strict violations across the whole tree on every change. It deliberately does
NOT attempt to verify runtime behaviour (that needs a real Spring/unitsync
install), so it stays fast, hermetic, and dependency-free.

Verified locally: prove -v t/ passes (9/9 sources compile).

Note

This is a proposal and imposes a small amount of CI maintenance, so feel free to
treat it as a starting point or close it if the approach isn't wanted. It's the
foundation a few follow-ups (a cpanfile, a perlcritic step, and eventually unit
tests around the config/data layer) would build on, but each of those is kept as
its own separate PR.

SPADS has no automated tests. This adds the cheapest possible regression net:
t/00-compile.t runs 'perl -c' on every source under src/, using generated stubs
for the sibling modules (SimpleLog, SimpleEvent, SpringLobbyInterface,
SpringAutoHostInterface, SpringLobbyProtocol) that are fetched at install time
and not vendored here.

It verifies the sources parse and compile (catching e.g. lexical-scope and
strict violations); it does not verify runtime behaviour. A GitHub Actions
workflow runs it via 'prove' on push and pull_request using only core Perl
modules (no dependency install needed).
@Yaribz

Yaribz commented Jul 2, 2026

Copy link
Copy Markdown
Owner

I'm not really convinced by the usefulness of this PR.

Instead, in commit 7181e96 I added a Github action for automated tests. It is far from exhaustive, but at least it does much more than just checking syntax/compile errors: it downloads SPADS dependencies, installs SPADS in autonomous mode (with embedded lobby server), with latest stable BAR engine, one mod, a set of 3 basic maps and a plugin named Tests that can be extended to add new tests (currently it only checks that SPADS correctly connects to the local lobby server and opens a battle room).

I prefer keeping this action as manual for now, but it can be easily switched to automatic in forked repositories if needed.

edit: actually I guess I will enable it for PR

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.

2 participants