| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
This PR deduplicates repeated “assert cache directory present/absent” shell logic in the cache E2E GitHub Actions workflows by introducing a shared __tests__/check-dir.sh helper and updating the workflows to call it.
Changes:
| File | Description |
|---|---|
| .github/workflows/e2e-cache.yml | Replaces repeated inline directory checks with calls to __tests__/check-dir.sh across gradle/maven/sbt jobs. |
| .github/workflows/e2e-cache-dependency-path.yml | Switches gradle cache dependency-path assertions to use the shared directory-check helper. |
| tests/check-dir.sh | New reusable script implementing present/absent directory assertions for workflow reuse. |
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
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>
…ditionals - 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>
| Back | FazBrowse Home | New Git URL |
What
e2e-cache.yml repeated the same inline shell block many times to assert that a cache directory exists (and then ls it), plus several inverse checks (the gradle2/maven2/sbt2 cache-miss jobs) asserting a directory does not exist.
This PR deduplicates that logic into a single helper script.
Changes
Validation