Skip to content

Commit

Permalink
ci: run the "bors build finished" jobs only during try and auto runs
Browse files Browse the repository at this point in the history
  • Loading branch information
pietroalbini committed Mar 24, 2020
1 parent ba97ad3 commit 89339df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Expand Up @@ -746,7 +746,7 @@ jobs:
try-success:
needs:
- try
if: success()
if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/try' && github.repository == 'rust-lang-ci/rust'"
steps:
- name: mark the job as a success
run: exit 0
Expand All @@ -755,7 +755,7 @@ jobs:
try-failure:
needs:
- try
if: "!success()"
if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/try' && github.repository == 'rust-lang-ci/rust'"
steps:
- name: mark the job as a failure
run: exit 1
Expand All @@ -764,7 +764,7 @@ jobs:
auto-success:
needs:
- auto
if: success()
if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
steps:
- name: mark the job as a success
run: exit 0
Expand All @@ -773,7 +773,7 @@ jobs:
auto-failure:
needs:
- auto
if: "!success()"
if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
steps:
- name: mark the job as a failure
run: exit 1
Expand Down
6 changes: 4 additions & 2 deletions src/ci/github-actions/ci.yml
Expand Up @@ -221,14 +221,12 @@ x--expand-yaml-anchors--remove:
runs-on: ubuntu-latest

- &base-success-job
if: success()
steps:
- name: mark the job as a success
run: exit 0
<<: *base-outcome-job

- &base-failure-job
if: "!success()"
steps:
- name: mark the job as a failure
run: exit 1
Expand Down Expand Up @@ -695,13 +693,17 @@ jobs:
# successful listening to webhooks only.
try-success:
needs: [try]
if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/try' && github.repository == 'rust-lang-ci/rust'"
<<: *base-success-job
try-failure:
needs: [try]
if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/try' && github.repository == 'rust-lang-ci/rust'"
<<: *base-failure-job
auto-success:
needs: [auto]
if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
<<: *base-success-job
auto-failure:
needs: [auto]
if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
<<: *base-failure-job

0 comments on commit 89339df

Please sign in to comment.