diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh index ca619aa7e98a1..e6a59a2ae1306 100755 --- a/.ci/monolithic-linux.sh +++ b/.ci/monolithic-linux.sh @@ -64,13 +64,13 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ start-group "ninja" -if [[ "${targets}" != "" ]]; then +if [[ -n "${targets}" ]]; then # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log cp ${BUILD_DIR}/.ninja_log ninja.ninja_log fi -if [[ "${runtime_targets}" != "" ]]; then +if [[ -n "${runtime_targets}" ]]; then start-group "ninja Runtimes" ninja -C "${BUILD_DIR}" ${runtime_targets} |& tee ninja_runtimes.log @@ -79,7 +79,7 @@ fi # Compiling runtimes with just-built Clang and running their tests # as an additional testing for Clang. -if [[ "${runtime_targets_needs_reconfig}" != "" ]]; then +if [[ -n "${runtime_targets_needs_reconfig}" ]]; then start-group "CMake Runtimes C++26" cmake \ diff --git a/.ci/monolithic-windows.sh b/.ci/monolithic-windows.sh index 99e7758ce8d79..36941644c6a6c 100755 --- a/.ci/monolithic-windows.sh +++ b/.ci/monolithic-windows.sh @@ -51,13 +51,13 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ start-group "ninja" -if [[ "${targets}" != "" ]]; then +if [[ -n "${targets}" ]]; then # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log cp ${BUILD_DIR}/.ninja_log ninja.ninja_log fi -if [[ "${runtimes_targets}" != "" ]]; then +if [[ -n "${runtimes_targets}" ]]; then start-group "ninja runtimes" ninja -C "${BUILD_DIR}" -k 0 ${runtimes_targets} |& tee ninja_runtimes.log diff --git a/.ci/utils.sh b/.ci/utils.sh index c364f9395d67b..713a07ba5d898 100644 --- a/.ci/utils.sh +++ b/.ci/utils.sh @@ -33,7 +33,7 @@ function at-exit { # If building fails there will be no results files. shopt -s nullglob - if [[ "$GITHUB_ACTIONS" != "" ]]; then + if [[ -n "$GITHUB_ACTIONS" ]]; then python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py \ $retcode "${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log \ >> $GITHUB_STEP_SUMMARY @@ -44,7 +44,7 @@ function at-exit { fi if [[ "$retcode" != "0" ]]; then - if [[ "$GITHUB_ACTIONS" != "" ]]; then + if [[ -n "$GITHUB_ACTIONS" ]]; then python "${MONOREPO_ROOT}"/.ci/premerge_advisor_upload.py \ $(git rev-parse HEAD~1) $GITHUB_RUN_NUMBER \ "${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log @@ -59,10 +59,10 @@ trap at-exit EXIT function start-group { groupname=$1 - if [[ "$GITHUB_ACTIONS" != "" ]]; then + if [[ -n "$GITHUB_ACTIONS" ]]; then echo "::endgroup" echo "::group::$groupname" - elif [[ "$POSTCOMMIT_CI" != "" ]]; then + elif [[ -n "$POSTCOMMIT_CI" ]]; then echo "@@@$STEP@@@" else echo "Starting $groupname" @@ -73,6 +73,6 @@ export PIP_BREAK_SYSTEM_PACKAGES=1 pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt # The ARM64 builders run on AWS and don't have access to the GCS cache. -if [[ "$GITHUB_ACTIONS" != "" ]] && [[ "$RUNNER_ARCH" != "ARM64" ]]; then +if [[ -n "$GITHUB_ACTIONS" ]] && [[ "$RUNNER_ARCH" != "ARM64" ]]; then python .ci/cache_lit_timing_files.py download fi