From 42aaa3f586c87f4459191e8fdb21579b3924bc3c Mon Sep 17 00:00:00 2001 From: Ruoyu Zhong Date: Mon, 16 Dec 2024 13:26:54 +0800 Subject: [PATCH] workflows: fix quoting of formula names The double quoting of formula names is broken after #201306. Let's fix it by moving out the double-quoted formula names to a separate variable. Should fix the failure seen in [1]. [1]: https://github.com/Homebrew/homebrew-core/actions/runs/12345589565/job/34449970508?pr=201322 --- .github/workflows/scripts/check-labels.js | 5 ----- .github/workflows/tests.yml | 17 +++++++++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/scripts/check-labels.js b/.github/workflows/scripts/check-labels.js index 88a3543da3d77..d55a6ac6bdb5b 100644 --- a/.github/workflows/scripts/check-labels.js +++ b/.github/workflows/scripts/check-labels.js @@ -70,12 +70,7 @@ module.exports = async ({github, context, core}, formulae_detect, dependent_test } const test_bot_formulae_args = ["--only-formulae", "--junit", "--only-json-tab", "--skip-dependents"] - test_bot_formulae_args.push(`--testing-formulae="${formulae_detect.testing_formulae}"`) - test_bot_formulae_args.push(`--added-formulae="${formulae_detect.added_formulae}"`) - test_bot_formulae_args.push(`--deleted-formulae="${formulae_detect.deleted_formulae}"`) - const test_bot_dependents_args = ["--only-formulae-dependents", "--junit"] - test_bot_dependents_args.push(`--tested-formulae="${formulae_detect.testing_formulae}"`) if (label_names.includes(`CI-test-bot-fail-fast${deps_suffix}`)) { console.log(`CI-test-bot-fail-fast${deps_suffix} label found. Passing --fail-fast to brew test-bot.`) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 538aad1033b2b..8f2f9ed1b8896 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -204,7 +204,7 @@ jobs: run: brew determine-test-runners "$TESTING_FORMULAE" "$DELETED_FORMULAE" tests: - needs: [tap_syntax, setup_tests, setup_runners] + needs: [tap_syntax, formulae_detect, setup_tests, setup_runners] if: > github.event_name == 'pull_request' && !fromJson(needs.setup_tests.outputs.syntax-only) && @@ -235,9 +235,15 @@ jobs: - id: brew-test-bot-formulae run: | # shellcheck disable=SC2086 - brew test-bot $TEST_BOT_FORMULAE_ARGS + brew test-bot $TEST_BOT_FORMULAE_ARGS \ + --testing-formulae="$TESTING_FORMULAE" \ + --added-formulae="$ADDED_FORMULAE" \ + --deleted-formulae="$DELETED_FORMULAE" env: TEST_BOT_FORMULAE_ARGS: ${{ needs.setup_tests.outputs.test-bot-formulae-args }} + TESTING_FORMULAE: ${{ needs.formulae_detect.outputs.testing_formulae }} + ADDED_FORMULAE: ${{ needs.formulae_detect.outputs.added_formulae }} + DELETED_FORMULAE: ${{ needs.formulae_detect.outputs.deleted_formulae }} working-directory: ${{ env.BOTTLES_DIR }} - name: Post-build steps @@ -324,7 +330,7 @@ jobs: run: brew determine-test-runners --dependents --eval-all "$TESTING_FORMULAE" test_deps: - needs: [tap_syntax, setup_dep_tests, setup_dep_runners, tests] + needs: [tap_syntax, formulae_detect, setup_dep_tests, setup_dep_runners, tests] if: > (success() || (failure() && @@ -361,9 +367,12 @@ jobs: - run: | # shellcheck disable=SC2086 - brew test-bot $TEST_BOT_DEPENDENTS_ARGS --testing-formulae="$TESTING_FORMULAE" + brew test-bot $TEST_BOT_DEPENDENTS_ARGS \ + --testing-formulae="$TESTING_FORMULAE" \ + --tested-formulae="$TESTED_FORMULAE" env: TEST_BOT_DEPENDENTS_ARGS: ${{ needs.setup_dep_tests.outputs.test-bot-dependents-args }} + TESTED_FORMULAE: ${{ needs.formulae_detect.outputs.testing_formulae }} working-directory: ${{ env.BOTTLES_DIR }} - name: Steps summary and cleanup