Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address review: argc guard in check-dir.sh, fix sbt ubuntu matrix con…
…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>
  • Loading branch information
brunoborges and Copilot committed Jul 15, 2026
commit 85f658438e855d6145d2c2574ce365f14c074982
4 changes: 2 additions & 2 deletions .github/workflows/e2e-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ jobs:
if: matrix.os == 'windows-latest'
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/AppData/Local/Coursier/Cache"
- name: Check files to cache on ubuntu-latest
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-22.04'
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier"
Comment thread
brunoborges marked this conversation as resolved.
Resolved
sbt-restore:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:
if: matrix.os == 'windows-latest'
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/AppData/Local/Coursier/Cache"
- name: Confirm that ~/.cache/coursier directory has been made
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-22.04'
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier"
Comment thread
brunoborges marked this conversation as resolved.
Resolved
gradle1-save:
runs-on: ${{ matrix.os }}
Expand Down
5 changes: 5 additions & 0 deletions __tests__/check-dir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
# tilde-expansion pitfalls.
set -eu

if [ "$#" -lt 1 ]; then
echo "Usage: check-dir.sh <dir> [present|absent]" >&2
exit 2
fi

dir=$1
mode=${2:-present}
Comment thread
brunoborges marked this conversation as resolved.
Resolved

Expand Down
Loading