Skip to content

Commit

Permalink
workflows: fix quoting of formula names
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ZhongRuoyu committed Dec 16, 2024
1 parent 36aa948 commit 42aaa3f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/scripts/check-labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.`)
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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() &&
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 42aaa3f

Please sign in to comment.