mirror of
https://code.forgejo.org/actions/checkout.git
synced 2025-04-21 17:12:03 +03:00
feat: added test for sparse-checkout
This commit is contained in:
parent
d963058cca
commit
360aefd1c1
3 changed files with 84 additions and 1 deletions
40
__test__/verify-sparse-checkout.sh
Executable file
40
__test__/verify-sparse-checkout.sh
Executable file
|
@ -0,0 +1,40 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Check that only sparse-checkout folders has been fetched
|
||||
for pattern in $(git ls-tree --name-only HEAD)
|
||||
do
|
||||
if [ -d "$pattern" ]; then
|
||||
if [[ "$pattern" != ".github" && "$pattern" != "src" ]]; then
|
||||
echo "Expected directory '$pattern' to not exist"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Check that .github and its childrens has been fetched correctly
|
||||
if [ ! -d "./.github" ]; then
|
||||
echo "Expected directory '.github' to exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for file in $(git ls-tree -r --name-only HEAD .github)
|
||||
do
|
||||
if [ ! -f "$file" ]; then
|
||||
echo "Expected file '$file' to exist"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# Check that src and its childrens has been fetched correctly
|
||||
if [ ! -d "./src" ]; then
|
||||
echo "Expected directory 'src' to exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for file in $(git ls-tree -r --name-only HEAD src)
|
||||
do
|
||||
if [ ! -f "$file" ]; then
|
||||
echo "Expected file '$file' to exist"
|
||||
exit 1
|
||||
fi
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue