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

Create an issue on nightly CI run failure #301

Merged
merged 1 commit into from
May 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,38 @@ jobs:
- name: Run tests
run: sh ci/run.sh ${{ matrix.os }}

create_issue:
runs-on: ubuntu-latest
# the combination of these two lines seems to do the "if build_and_test failed, run this one"
needs: build_and_test
if: always() && github.event_name == 'schedule' && needs.build_and_test.result == 'failure'
dario23 marked this conversation as resolved.
Show resolved Hide resolved

permissions:
issues: write

steps:
- name: Create an issue
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
readarray -t exists < <(gh issue list --state open --label nightly-CI-failed --json number --jq '.[].number' --repo "$GITHUB_REPOSITORY")
if [[ -n "${exists[@]}" ]]; then
echo "Not opening another issue, already have ${#exists[@]} issue(s), latest at ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/issues/${exists[0]}."
else
cat << EOF | gh issue create \
--label nightly-CI-failed \
dario23 marked this conversation as resolved.
Show resolved Hide resolved
--title "Nightly CI run failed" \
--repo "$GITHUB_REPOSITORY" \
--body-file -
The nightly CI run on $(date +%F) seems to have failed.

- Check the logs at ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }}
- Update to the latest 'rustc-nightly' if necessary
- Investigate test run failures if any
EOF
fi

# https://forge.rust-lang.org/infra/docs/bors.html#adding-a-new-repository-to-bors
build_result:
name: bors build finished
Expand Down