mirror of
https://github.com/actions/checkout.git
synced 2025-03-31 05:20:06 +02:00
feat: added __test__ as sparse-checkout directory in order to be able to have the test scripts
This commit is contained in:
parent
c6f93f5909
commit
55b0bfb9c8
2 changed files with 17 additions and 2 deletions
3
.github/workflows/test.yml
vendored
3
.github/workflows/test.yml
vendored
|
@ -117,7 +117,7 @@ jobs:
|
||||||
- name: Sparse checkout basic example
|
- name: Sparse checkout basic example
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
sparse-checkout: .
|
sparse-checkout: __test__
|
||||||
- name: Verify sparse checkout basic
|
- name: Verify sparse checkout basic
|
||||||
run: __test__/verify-sparse-checkout-basic.sh
|
run: __test__/verify-sparse-checkout-basic.sh
|
||||||
|
|
||||||
|
@ -126,6 +126,7 @@ jobs:
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
sparse-checkout: |
|
sparse-checkout: |
|
||||||
|
__test__
|
||||||
.github
|
.github
|
||||||
src
|
src
|
||||||
- name: Verify sparse checkout basic
|
- name: Verify sparse checkout basic
|
||||||
|
|
|
@ -4,13 +4,27 @@
|
||||||
for pattern in $(git ls-tree --name-only HEAD)
|
for pattern in $(git ls-tree --name-only HEAD)
|
||||||
do
|
do
|
||||||
if [ -d "$pattern" ]; then
|
if [ -d "$pattern" ]; then
|
||||||
if [[ "$pattern" != ".github" && "$pattern" != "src" ]]; then
|
if [[ "$pattern" != "__test__" && "$pattern" != ".github" && "$pattern" != "src" ]]; then
|
||||||
echo "Expected directory '$pattern' to not exist"
|
echo "Expected directory '$pattern' to not exist"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Check that .github and its childrens has been fetched correctly
|
||||||
|
if [ ! -d "./__test__" ]; then
|
||||||
|
echo "Expected directory '__test__' to exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
for file in $(git ls-tree -r --name-only HEAD __test__)
|
||||||
|
do
|
||||||
|
if [ ! -f "$file" ]; then
|
||||||
|
echo "Expected file '$file' to exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# Check that .github and its childrens has been fetched correctly
|
# Check that .github and its childrens has been fetched correctly
|
||||||
if [ ! -d "./.github" ]; then
|
if [ ! -d "./.github" ]; then
|
||||||
echo "Expected directory '.github' to exist"
|
echo "Expected directory '.github' to exist"
|
||||||
|
|
Loading…
Add table
Reference in a new issue