File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change 4141 run : bash ci/setup-toolchain.sh
4242 if : github.event_name == 'schedule'
4343 - name : Run tests
44- run : sh ci/run.sh ${{ matrix.os }}
44+ run : sh -c "exit 1"
45+
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() && 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
4577
4678 # https://forge.rust-lang.org/infra/docs/bors.html#adding-a-new-repository-to-bors
4779 build_result :
You can’t perform that action at this time.
0 commit comments