Skip to content

Commit

Permalink
feat(ci): skip check when only documentation files hyperledger-cacti#…
Browse files Browse the repository at this point in the history
…1014

Signed-off-by: AzaharaC <a.castano.benito@accenture.com>
  • Loading branch information
AzaharaC committed Sep 15, 2021
1 parent d54c6a3 commit 04d3e57
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion 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 All @@ -85,7 +107,7 @@ function mainTask()
npm --version
java -version

# install npm 7 globally - needed because Node v12, v14 default to npm v6
install npm 7 globally - needed because Node v12, v14 default to npm v6
npm install -g npm@7.19.1
npm --version
yarn --version
Expand Down

0 comments on commit 04d3e57

Please sign in to comment.