[continuous-integration] remove git clean in scripts (#4988)

This removes the use of `git clean` in scripts to prevent accidental
loss of work.
This commit is contained in:
Moandor
2020-05-20 17:55:50 -07:00
committed by GitHub
parent fa96bcd10f
commit 93c55f5837
4 changed files with 42 additions and 36 deletions
+9 -8
View File
@@ -29,6 +29,9 @@
set -euxo pipefail
readonly OT_SRCDIR="$(pwd)"
readonly OT_BUILDDIR="$OT_SRCDIR/build"
readonly OT_COMMON_OPTIONS=(
"-DOT_COMPILE_WARNING_AS_ERROR=on"
"-DOT_PLATFORM=simulation"
@@ -36,8 +39,7 @@ readonly OT_COMMON_OPTIONS=(
reset_source()
{
git checkout -- .
git clean -xfd
rm -rf "$OT_BUILDDIR"
}
build_all_features()
@@ -71,21 +73,20 @@ build_all_features()
reset_source
git checkout -- .
git clean -xfd
mkdir build && cd build
mkdir -p "$OT_BUILDDIR"
cd "$OT_BUILDDIR"
cmake -GNinja "${options[@]}" ..
ninja
cd ..
cd "$OT_SRCDIR"
}
build_toranj()
{
reset_source
./tests/toranj/build.sh cmake
top_builddir="$OT_BUILDDIR" ./tests/toranj/build.sh cmake
reset_source
./tests/toranj/build.sh cmake-posix
top_builddir="$OT_BUILDDIR" ./tests/toranj/build.sh cmake-posix
}
main()