Skip to content

Commit

Permalink
Merge pull request #1596 from messense/merge-group
Browse files Browse the repository at this point in the history
Try GitHub Actions merge queue
  • Loading branch information
messense authored May 7, 2023
2 parents 7421443 + bba12bd commit d1a1bd9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:

build_and_test: &BUILD_AND_TEST
# only run tasks on pull request or bors related branches
only_if: $CIRRUS_BRANCH == 'staging' || $CIRRUS_BRANCH == 'trying' || $CIRRUS_PR != ""
only_if: $CIRRUS_BRANCH =~ 'gh-readonly-queue/.*' || $CIRRUS_PR != ""
setup_script:
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
- rustup target add wasm32-wasi
Expand Down
35 changes: 3 additions & 32 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
name: Test

on:
push:
branches:
# for bors r+
- staging
# for bors try
- trying
pull_request:
paths-ignore:
- "guide/**"
Expand All @@ -15,6 +9,7 @@ on:
- ".cirrus.yml"
- ".github/ISSUE_TEMPLATE/**"
- ".github/dependabot.yml"
merge_group:
workflow_dispatch:

concurrency:
Expand Down Expand Up @@ -43,28 +38,11 @@ jobs:
const OS = yaml.load(process.env.OS_MATRIX)
const PYTHON_VERSIONS = yaml.load(process.env.PYTHON_VERSION)
if (context.eventName == 'workflow_dispatch') {
// Run all of them on workflow dispatch
if (context.eventName == 'workflow_dispatch' || context.eventName == 'merge_group') {
// Run all of them on workflow dispatch or merge group
core.setOutput('os', OS)
core.setOutput('python-version', PYTHON_VERSIONS)
core.setOutput('fail-fast', 'false')
} else if (context.eventName == 'push') {
const commitMessage = process.env.COMMIT_MESSAGE.trim()
const matches = commitMessage.match(/(Try|Merge) #([0-9]+):/)
if (matches) {
const prNumber = matches[2]
const { data: { labels: labels } } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber
})
const labelNames = labels.map(label => label.name)
if (labelNames.includes('CI-no-fail-fast')) {
core.setOutput('fail-fast', 'false')
}
}
core.setOutput('os', OS)
core.setOutput('python-version', PYTHON_VERSIONS)
} else if (context.eventName == 'pull_request') {
const { data: { labels: labels } } = await github.rest.pulls.get({
owner: context.repo.owner,
Expand All @@ -84,13 +62,6 @@ jobs:
core.setOutput('os', OS.filter(os => !os.startsWith('macos')))
}
env:
COMMIT_MESSAGE: >
${{
((
(startsWith(github.event.head_commit.message, 'Try #') || startsWith(github.event.head_commit.message, 'Merge #')) &&
github.event.head_commit.author.username == 'bors[bot]'
) && github.event.head_commit.message) || ''
}}
OS_MATRIX: |
- ubuntu-latest
- macos-latest
Expand Down

0 comments on commit d1a1bd9

Please sign in to comment.