From bd3668d249f380b66261ef2b721760c1357b7d61 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Tue, 13 Oct 2020 11:13:00 +0700 Subject: [PATCH] More exact checks for bors --- .github/workflows/main.yml | 22 ++++++++++++++++++++++ bors.toml | 9 +-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b7be1d6..fed2e00 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,3 +84,25 @@ jobs: -A clippy::redundant_field_names done shell: bash + + # These jobs doesn't actually test anything, but they're only used to tell + # bors the build completed, as there is no practical way to detect when a + # workflow is successful listening to webhooks only. + # + # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB! + end-success: + name: bors build finished + runs-on: ubuntu-latest + needs: [build, redox_check, rustfmt, minimum-rust-version] + if: github.actor == 'bors[bot]' && success() + steps: + - name: mark the job as a success + run: exit 0 + end-failure: + name: bors build finished + runs-on: ubuntu-latest + needs: [build, redox_check, rustfmt, minimum-rust-version] + if: github.actor == 'bors[bot]' && (failure() || cancelled()) + steps: + - name: mark the job as a failure + run: exit 1 diff --git a/bors.toml b/bors.toml index bdca237..444af25 100644 --- a/bors.toml +++ b/bors.toml @@ -1,11 +1,4 @@ -status = [ - "build (ubuntu-latest)", - "build (windows-latest)", - "build (macos-latest)", - "minimum-rust-version (ubuntu-latest)", - "minimum-rust-version (windows-latest)", - "minimum-rust-version (macos-latest)", -] +status = ["bors build finished"] # Default timeout is one hour timeout_sec = 600