Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 3884350

Browse files
committed
Auto merge of #301 - dario23:issue-on-ci-failure, r=JohnTitor
Create an issue on nightly CI run failure Implements #299 fixes #299
2 parents 0431504 + 02cba1d commit 3884350

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/ci.yml

+32
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,38 @@ jobs:
4343
- name: Run tests
4444
run: sh ci/run.sh ${{ matrix.os }}
4545

46+
create_issue:
47+
runs-on: ubuntu-latest
48+
# the combination of these two lines seems to do the "if build_and_test failed, run this one"
49+
needs: build_and_test
50+
if: always() && github.event_name == 'schedule' && needs.build_and_test.result == 'failure'
51+
52+
permissions:
53+
issues: write
54+
55+
steps:
56+
- name: Create an issue
57+
shell: bash
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
run: |
61+
readarray -t exists < <(gh issue list --state open --label nightly-CI-failed --json number --jq '.[].number' --repo "$GITHUB_REPOSITORY")
62+
if [[ -n "${exists[@]}" ]]; then
63+
echo "Not opening another issue, already have ${#exists[@]} issue(s), latest at ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/issues/${exists[0]}."
64+
else
65+
cat << EOF | gh issue create \
66+
--label nightly-CI-failed \
67+
--title "Nightly CI run failed" \
68+
--repo "$GITHUB_REPOSITORY" \
69+
--body-file -
70+
The nightly CI run on $(date +%F) seems to have failed.
71+
72+
- Check the logs at ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }}
73+
- Update to the latest 'rustc-nightly' if necessary
74+
- Investigate test run failures if any
75+
EOF
76+
fi
77+
4678
# https://forge.rust-lang.org/infra/docs/bors.html#adding-a-new-repository-to-bors
4779
build_result:
4880
name: bors build finished

0 commit comments

Comments
 (0)