Learning center

CI passed, but did it fetch the submodules?

Not unless the workflow asked. The actions/checkout action leaves submodule directories empty by default, and a test suite that skips when its fixtures are missing then passes with exit code 0. Check git submodule status in the job log; a leading - means the submodule was never checked out, and the tests that depend on it did not run.

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#

ObservationCausesWhat settles it
- prefix in git submodule statussubmodules not set, or set on a different checkout stepThe checkout step's inputs in the log
Space prefix, but tests still skipThe guard checks a different path, or the data needs Git LFSThe skip reason and the files on disk
+ prefixA submodule at a commit other than the one the superproject recordsgit submodule status and git diff in the job
No skips, still passingThe tests never read the submoduleCoverage 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.

One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. Eligibility and fair-use terms.

Start free with GitHub

Related reading