From d56b551e3965ae28a60180bae97683bb67ca368f Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Wed, 2 Nov 2022 01:29:41 -0400 Subject: [PATCH] ci: try only having cancel-in-progress for non-main branch (#864) --- .github/workflows/ci.yml | 16 ++++++++++------ .github/workflows/coverage.yml | 4 ++-- .github/workflows/test-docs.yml | 4 ++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 093795ce..5c338655 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,10 +5,14 @@ # - https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/ci.yml # - https://www.reillywood.com/blog/rust-faster-ci/ # -# It should do the following: -# - cargo fmt on supported platforms -# - cargo test on supported platforms, cargo check on unsupported -# - cargo clippy after (apparently faster) on supported platforms +# It should run the following: +# Supported platforms: +# - cargo fmt +# - cargo test +# - cargo clippy after (apparently faster to do so) +# +# Unsupported platforms: +# - cargo check name: ci @@ -25,8 +29,8 @@ env: CARGO_HUSKY_DONT_INSTALL_HOOKS: true concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'ClementTsang/bottom' }} jobs: # Check if things should be skipped. diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index f1f49ffe..5e4f85f5 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -13,8 +13,8 @@ env: CARGO_INCREMENTAL: 0 concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'ClementTsang/bottom' }} jobs: pre_job: diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index 9fb4d288..9f76a306 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -6,8 +6,8 @@ on: pull_request: concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'ClementTsang/bottom' }} jobs: pre_job: