What the default checkout leaves out#
The submodules input of actions/checkout takes true to check out submodules or recursive for nested ones, and its default is false. actions/checkout usage In a clone without submodules, the submodule path is an empty directory, as the fixture below shows.
Git marks this state in git submodule status. Its documentation says each SHA-1 is "prefixed with - if the submodule is not initialized". git-submodule
A suite that passes without its data#
This fixture has an application repository whose test vectors live in a submodule at vendor/vectors. The test class is skipped when the directory is empty, a common guard for optional data. The parser has a bug that only a vector exercises. Cloned without submodules, as the default checkout does:
== clone without submodules (actions/checkout default)
$ ls -A vendor/vectors
$ git submodule status
-e3d01a0342fcb3ad64e8e28627c1fdc07841af1d vendor/vectors
$ python3 -m unittest -v
test_integer (test_parse.Basic.test_integer) ... ok
test_vectors (test_parse.Vectors.test_vectors) ... skipped 'test vectors not present'
[…]
OK (skipped=1)
exit 0
The same commit cloned with submodules:
== clone with submodules
$ git submodule status
e3d01a0342fcb3ad64e8e28627c1fdc07841af1d vendor/vectors (heads/main)
[…]
ValueError: invalid literal for int() with base 10: '1e3'
[…]
FAILED (errors=1)
exit 1
The first run is green and records only a skip. The commit has a failing test, and the default checkout never ran it.
What else produces a green run with an empty submodule#
| Observation | Causes | What settles it |
|---|---|---|
- prefix in git submodule status | submodules not set, or set on a different checkout step | The checkout step's inputs in the log |
| Space prefix, but tests still skip | The guard checks a different path, or the data needs Git LFS | The skip reason and the files on disk |
+ prefix | A submodule at a commit other than the one the superproject records | git submodule status and git diff in the job |
| No skips, still passing | The tests never read the submodule | Coverage of the code that uses it |
Make the job prove it#
Request the submodules and record what was checked out:
- uses: actions/checkout@v7
with:
submodules: recursive
- run: git submodule status --recursive
Then make missing data a failure in CI instead of a skip: fail when any line of git submodule status starts with -, or make the test guard read an environment variable that CI sets so the class cannot skip there.
Skipped tests that pass silently are covered more broadly in a filtered test run with zero tests; Git LFS files fail the same way, see checkout left LFS pointer files. Return to handing over evidence.