Skip to content

Commit

Permalink
Add auto cancel step for outdated commit (#5191)
Browse files Browse the repository at this point in the history
* Add auto cancel step for outdated commit

* refine
  • Loading branch information
jackalcooper committed Jun 14, 2021
1 parent e5514d0 commit 04046fc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ on:
description: "placeholder, no effect"
required: false
jobs:
cancel_previous:
name: Cancel previous runs
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs of outdated commit
uses: styfle/cancel-workflow-action@0.9.0
with:
access_token: ${{ github.token }}

mirror_third_party:
name: Mirror third party dependencies
runs-on: ubuntu-18.04
Expand Down Expand Up @@ -106,7 +115,7 @@ jobs:

build:
name: Build
needs: [check_license_and_format, mirror_third_party]
needs: [check_license_and_format, mirror_third_party, cancel_previous]
continue-on-error: ${{ matrix.allow_fail }}
runs-on: ${{ matrix.os }}
if: github.event.pull_request.draft == false && github.base_ref == 'master' && contains(github.event.pull_request.requested_reviewers.*.login, 'oneflow-ci-bot') && contains(github.event.pull_request.labels.*.name, 'fmt-only') == false
Expand Down

0 comments on commit 04046fc

Please sign in to comment.