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

Commit a4b302b

Browse files
committed
Create an issue on nightly CI run failure
1 parent 71d2bb1 commit a4b302b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,32 @@ 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+
steps:
53+
- name: Create an issue
54+
shell: bash
55+
run: |
56+
readarray -t exists < <(gh issue list --state open --label nightly-CI-failed --json number --jq '.[].number')
57+
if [ -n "${exists[@]}" ]; then
58+
echo "Not opening another issue, already have ${#exists[@]} issue(s), latest at https://github.com/rust-lang/rust-semverver/issues/${exists[0]}."
59+
else
60+
cat << EOF | gh issue create \
61+
--label nightly-CI-failed \
62+
--title "Nightly CI run failed" \
63+
--body-file -
64+
The nightly CI run on $(date +%F) seems to have failed.
65+
66+
- Check the logs at https://github.com/rust-lang/rust-semverver/actions/runs/${{ github.run_id }}
67+
- Update to the latest `rustc-nightly` if necessary
68+
- Investigate test run failures if any
69+
EOF
70+
fi
71+
4672
# https://forge.rust-lang.org/infra/docs/bors.html#adding-a-new-repository-to-bors
4773
build_result:
4874
name: bors build finished

0 commit comments

Comments
 (0)