diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30341e29..ae52cc7a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,41 @@ jobs: run: bash ci/setup-toolchain.sh if: github.event_name == 'schedule' - name: Run tests - run: sh ci/run.sh ${{ matrix.os }} + run: sh -c "exit 1" + + 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 + # TEST: remove the nightly trigger condition + if: always() && needs.build_and_test.result == 'failure' + + permissions: + issues: write + + steps: + - name: Create an issue + shell: bash + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -x + 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 \ + --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: diff --git a/tests/cases/addition/stdout b/tests/cases/addition/stdout index 3f8c0cbd..bb748815 100644 --- a/tests/cases/addition/stdout +++ b/tests/cases/addition/stdout @@ -56,3 +56,5 @@ warning: path changes to `Cde` warning: 6 warnings emitted + +ERROR