4b0728bd0d
* Extract repeated directory-check assertions into check-dir.sh helper The e2e-cache.yml workflow repeated the same inline shell block many times to assert a cache directory exists (and list it), plus inverse checks that a directory does NOT exist (the gradle2/maven2/sbt2 cache-miss jobs). Add `__tests__/check-dir.sh` (POSIX sh, executable) with a `check-dir.sh <dir> [present|absent]` interface and replace every inline check with a call to it, passing already-expanded $HOME paths to avoid tilde-expansion pitfalls. The sbt jobs override working-directory, so they call the helper via $GITHUB_WORKSPACE. Per-OS Coursier conditionals and all build steps are left unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Address review: argc guard in check-dir.sh, fix sbt ubuntu matrix conditionals - check-dir.sh: with set -u, invoking without a <dir> argument failed with an opaque "parameter not set" error. Add an explicit argc check that prints a usage message and exits 2 (distinct from the assertion failure code 1). - e2e-cache.yml: the sbt-save and sbt-restore jobs run on an ubuntu-22.04 matrix entry, but their coursier-cache steps were guarded by 'if: matrix.os == "ubuntu-latest"', so those checks never executed on Ubuntu. Align the conditionals with the matrix (ubuntu-22.04), matching the newer sbt1/sbt2 jobs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>