Skip to content

Commit 4c794c6

Browse files
authored
Merge pull request #255897 from Homebrew/tests-nodejs-and-concurrent-downloads
workflows/tests: check nodejs label via check-labels.js
2 parents c581648 + 4b77b18 commit 4c794c6

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

.github/workflows/scripts/check-labels.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ module.exports = async ({github, context, core}, formulae_detect, dependent_test
7373
const test_bot_dependents_args = ["--only-formulae-dependents", "--junit"]
7474

7575
if (label_names.includes(`CI-test-bot-no-concurrent-downloads`)) {
76-
console.log(`CI-test-bot-no-concurrent-downloads label found. Not passing --concurrent-downloads to brew test-bot.`)
76+
console.log(`CI-test-bot-no-concurrent-downloads label found. Running with HOMEBREW_DOWNLOAD_CONCURRENCY=1`)
77+
core.setOutput('download-concurrency', '1')
7778
} else {
78-
console.log(`No CI-test-bot-no-concurrent-downloads label found. Passing --concurrent-downloads to brew test-bot.`)
79-
test_bot_formulae_args.push('--concurrent-downloads')
80-
test_bot_dependents_args.push('--concurrent-downloads')
79+
console.log(`No CI-test-bot-no-concurrent-downloads label found. Running with HOMEBREW_DOWNLOAD_CONCURRENCY=auto`)
80+
core.setOutput('download-concurrency', 'auto')
8181
}
8282

8383
if (label_names.includes(`CI-test-bot-fail-fast${deps_suffix}`)) {
@@ -146,4 +146,6 @@ module.exports = async ({github, context, core}, formulae_detect, dependent_test
146146

147147
core.setOutput('test-bot-formulae-args', test_bot_formulae_args.join(" "))
148148
core.setOutput('test-bot-dependents-args', test_bot_dependents_args.join(" "))
149+
150+
core.setOutput('nodejs', label_names.includes('nodejs'))
149151
}

.github/workflows/tests.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,12 @@ jobs:
143143
long-timeout: ${{ steps.check-labels.outputs.long-timeout }}
144144
test-bot-formulae-args: ${{ steps.check-labels.outputs.test-bot-formulae-args }}
145145
test-bot-dependents-args: ${{ steps.check-labels.outputs.test-bot-dependents-args }}
146+
download-concurrency: ${{ steps.check-labels.outputs.download-concurrency }}
146147
steps:
147148
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
148149
with:
149150
persist-credentials: false
150151

151-
- name: Check if nodejs formula
152-
if: contains(github.event.pull_request.labels.*.name, 'nodejs')
153-
run: exit 1
154-
155152
- name: Check for CI labels
156153
id: check-labels
157154
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
@@ -178,6 +175,10 @@ jobs:
178175
console.error(error);
179176
}
180177
178+
- name: Check if nodejs formula
179+
if: fromJson(steps.check-labels.outputs.nodejs)
180+
run: exit 1
181+
181182
setup_runners:
182183
needs: [formulae_detect, setup_tests]
183184
if: >
@@ -244,6 +245,7 @@ jobs:
244245
--deleted-formulae="$DELETED_FORMULAE" \
245246
<<<"$TEST_BOT_FORMULAE_ARGS"
246247
env:
248+
HOMEBREW_DOWNLOAD_CONCURRENCY: ${{ needs.setup_tests.outputs.download-concurrency }}
247249
TEST_BOT_FORMULAE_ARGS: ${{ needs.setup_tests.outputs.test-bot-formulae-args }}
248250
TESTING_FORMULAE: ${{ needs.formulae_detect.outputs.testing_formulae }}
249251
ADDED_FORMULAE: ${{ needs.formulae_detect.outputs.added_formulae }}
@@ -273,6 +275,7 @@ jobs:
273275
long-timeout: ${{ steps.check-labels.outputs.long-timeout }}
274276
test-bot-formulae-args: ${{ steps.check-labels.outputs.test-bot-formulae-args }}
275277
test-bot-dependents-args: ${{ steps.check-labels.outputs.test-bot-dependents-args }}
278+
download-concurrency: ${{ steps.check-labels.outputs.download-concurrency }}
276279
steps:
277280
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
278281
with:
@@ -376,6 +379,7 @@ jobs:
376379
--tested-formulae="$TESTED_FORMULAE" \
377380
<<<"$TEST_BOT_DEPENDENTS_ARGS"
378381
env:
382+
HOMEBREW_DOWNLOAD_CONCURRENCY: ${{ needs.setup_dep_tests.outputs.download-concurrency }}
379383
TEST_BOT_DEPENDENTS_ARGS: ${{ needs.setup_dep_tests.outputs.test-bot-dependents-args }}
380384
TESTED_FORMULAE: ${{ needs.formulae_detect.outputs.testing_formulae }}
381385
working-directory: ${{ env.BOTTLES_DIR }}

0 commit comments

Comments
 (0)