Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): skip check when only documentation files #1014 #1336

Merged
merged 3 commits into from
Sep 21, 2021
Merged
Changes from 2 commits
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
22 changes: 22 additions & 0 deletions tools/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,25 @@ function dumpDiskUsageInfo()
fi
}

function checkOnlyDocumentation()
{
z=0

for i in $CHANGED_FILES; do
z=$((z+1))
if [ ${i: -3} != ".md" ]; then
break
elif [ ${i: -3} == ".md" ] && [ $(echo ${CHANGED_FILES} | wc -l) == $z ]; then
echo 'There are only changes in the documentation files.'
ENDED_AT=`date +%s`
runtime=$((ENDED_AT-STARTED_AT))
echo "$(date +%FT%T%z) [CI] SUCCESS - runtime=$runtime seconds."
checkWorkTreeStatus
exit 0
fi
done
}

function mainTask()
{
set -euxo pipefail
Expand All @@ -61,6 +80,9 @@ function mainTask()
smem --abbreviate --totals --system || true
fi

# Check if the modified files are only for documentation.
checkOnlyDocumentation

dumpDiskUsageInfo

# If we are running in a GitHub Actions runner, then free up 30 GB space by
Expand Down