Skip to content

Commit

Permalink
Fix typo when checking cirque cache save action (#26007)
Browse files Browse the repository at this point in the history
* Fix typo when checking cirque cache save action

* Fix cirque bootstrap when GITHUB_CACHE_PATH is not created
  • Loading branch information
arkq authored Apr 6, 2023
1 parent e4fc66a commit 1d73d5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

set -xe

me=$(basename "$0")
SOURCE=${BASH_SOURCE[0]}
cd "$(dirname "$SOURCE")"

Expand All @@ -41,7 +42,7 @@ GITHUB_ACTION_RUN=${GITHUB_ACTION_RUN:-"0"}

REPO_DIR="$SOURCE_DIR/../../../../"

if [[ "x$GITHUB_ACTION_RUN" = "x1" ]]; then
if [[ "$GITHUB_ACTION_RUN" = "1" ]]; then
# Note: This script will be invoked in docker on CI, We should ensure CHIP repo to safe directory to silent git error messages.
git config --global --add safe.directory /home/runner/work/connectedhomeip/connectedhomeip
fi
Expand Down Expand Up @@ -98,7 +99,7 @@ fi

docker build -t "$ORG/$IMAGE" -f "$SOURCE_DIR/Dockerfile" "${BUILD_ARGS[@]}" --build-arg OT_BR_POSIX_CHECKOUT="$OT_BR_POSIX_CHECKOUT" "$SOURCE_DIR"

if [[ -n GITHUB_ACTION_RUN ]]; then
if [[ "$GITHUB_ACTION_RUN" = "1" ]]; then
# Save cache
mkdir -p "$CIRQUE_CACHE_PATH"
docker save -o "$IMAGE_SAVE_PATH" "$ORG/$IMAGE"
Expand Down
9 changes: 6 additions & 3 deletions scripts/tests/cirque_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Don't warn about unreachable commands in this file:
# shellcheck disable=SC2317

SOURCE=${BASH_SOURCE[0]}
SOURCE_DIR=$(cd "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd)
Expand Down Expand Up @@ -76,6 +78,7 @@ function __cirquetest_clean_flask() {
function __cirquetest_build_ot() {
echo -e "[$BOLD_YELLOW_TEXT""INFO""$RESET_COLOR] Cache miss, build openthread simulation."
script/cmake-build simulation -DOT_THREAD_VERSION=1.2 -DOT_MTD=OFF -DOT_FTD=OFF -DWEB_GUI=0 -DNETWORK_MANAGER=0 -DREST_API=0 -DNAT64=0
mkdir -p "$(dirname "$OT_SIMULATION_CACHE")"
tar czf "$OT_SIMULATION_CACHE" build
echo "$OPENTHREAD_CHECKOUT" >"$OT_SIMULATION_CACHE_STAMP_FILE"
}
Expand Down Expand Up @@ -113,7 +116,7 @@ function cirquetest_bootstrap() {

make NO_GRPC=1 install -j

if [[ "x$GITHUB_ACTION_RUN" = "x1" ]]; then
if [[ "$GITHUB_ACTION_RUN" = "1" ]]; then
# Note: This script will be invoked in docker on CI, We should add CHIP repo to safe directory to silent git error messages.
git config --global --add safe.directory /home/runner/work/connectedhomeip/connectedhomeip
fi
Expand All @@ -140,7 +143,7 @@ function cirquetest_run_test() {

# After test finished, the container is perserved and networks will not be deleted
# This is useful when running tests on local workstation, but not for CI.
if [[ "x$CLEANUP_DOCKER_FOR_CI" = "x1" ]]; then
if [[ "$CLEANUP_DOCKER_FOR_CI" = "1" ]]; then
echo "Do docker container and network prune"
# TODO: Filter cirque containers ?
if ! grep docker.sock /proc/1/mountinfo; then
Expand Down Expand Up @@ -169,7 +172,7 @@ function cirquetest_run_all_tests() {
fi
done

if [[ "x$GITHUB_ACTION_RUN" = "x1" ]]; then
if [[ "$GITHUB_ACTION_RUN" = "1" ]]; then
echo -e "[$BOLD_YELLOW_TEXT""INFO""$RESET_COLOR] Logs will be uploaded to artifacts."
fi

Expand Down

0 comments on commit 1d73d5c

Please sign in to comment.