Skip to content

Commit

Permalink
ci: verify that an existing sparse checkout can be made unsparse
Browse files Browse the repository at this point in the history
There are use cases in particular with non-ephemeral runners where an
existing worktree (that has been initialized as a sparse checkout) is
reused in subsequent CI runs (where `actions/checkout` is run _without_
any `sparse-checkout` parameter).

In these scenarios, we need to make sure that the sparse checkout is
disabled before checking out the files.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Jan 31, 2024
1 parent c4cda12 commit 6f108b2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/test.yml
Expand Up @@ -95,6 +95,16 @@ jobs:
- name: Verify sparse checkout
run: __test__/verify-sparse-checkout.sh

# Disabled sparse checkout in existing checkout
- name: Disabled sparse checkout
uses: ./
with:
path: sparse-checkout

- name: Verify disabled sparse checkout
shell: bash
run: set -x && ls -l sparse-checkout/src/git-command-manager.ts

# Sparse checkout (non-cone mode)
- name: Sparse checkout (non-cone mode)
uses: ./
Expand Down Expand Up @@ -279,4 +289,4 @@ jobs:
- name: Fix Checkout v3
uses: actions/checkout@v3
with:
path: v3
path: v3

0 comments on commit 6f108b2

Please sign in to comment.