ci: test cancelling stale actions (#851)

Use Github Action's concurrency settings to cancel old actions in favour of newer ones.
This commit is contained in:
Clement Tsang 2022-10-25 01:24:08 -04:00 committed by GitHub
parent 97ba34e3f4
commit 4240a38ced
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 6 deletions

View file

@ -1,11 +1,11 @@
# Main CI pipeline to validate PRs.
# Main CI workflow to validate PRs.
#
# CI pipeline based on:
# CI workflow based on:
# - https://github.com/heim-rs/heim/blob/master/.github/workflows/ci.yml
# - https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/ci.yml
# - https://www.reillywood.com/blog/rust-faster-ci/
#
# CI pipeline should do:
# 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
@ -24,6 +24,10 @@ env:
CARGO_PROFILE_DEV_DEBUG: 0
CARGO_HUSKY_DONT_INSTALL_HOOKS: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Runs rustfmt + tests + clippy on the main supported platforms.
supported:
@ -54,7 +58,6 @@ jobs:
id: skip_check
uses: fkirc/skip-duplicate-actions@f11521568414503656a5af807dc3018c012552c4 # v5.2.0
with:
concurrent_skipping: "same_content_newer"
skip_after_successful_duplicate: "true"
paths: '[".cargo/**", ".github/workflows/ci.yml", "sample_configs/**", "src/**", "tests/**", "build.rs", "Cargo.lock", "Cargo.toml", "clippy.toml", "rustfmt.toml"]'
do_not_skip: '["workflow_dispatch", "push"]'
@ -209,7 +212,6 @@ jobs:
id: skip_check
uses: fkirc/skip-duplicate-actions@f11521568414503656a5af807dc3018c012552c4 # v5.2.0
with:
concurrent_skipping: "same_content_newer"
skip_after_successful_duplicate: "true"
paths: '[".cargo/**", ".github/workflows/ci.yml", "sample_configs/**", "src/**", "tests/**", "build.rs", "Cargo.lock", "Cargo.toml", "clippy.toml", "rustfmt.toml"]'
do_not_skip: '["workflow_dispatch", "push"]'

View file

@ -12,6 +12,10 @@ on:
env:
CARGO_INCREMENTAL: 0
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pre_job:
runs-on: ubuntu-latest
@ -21,7 +25,6 @@ jobs:
- id: skip_check
uses: fkirc/skip-duplicate-actions@f11521568414503656a5af807dc3018c012552c4 # v5.2.0
with:
concurrent_skipping: "same_content_newer"
skip_after_successful_duplicate: "false"
paths: '["tests/**", "src/**", ".github/workflows/coverage.yml", ".cargo/**", "Cargo.toml", "Cargo.lock", "build.rs"]'
do_not_skip: '["workflow_dispatch", "push"]'

View file

@ -1,3 +1,5 @@
# Workflow to deploy mkdocs documentation.
name: docs
on:
workflow_dispatch:

View file

@ -1,4 +1,5 @@
# Actions to run after releasing a version, like generating documentation via mkdocs or notifying packaging repos.
name: post-release
on:

View file

@ -1,8 +1,14 @@
# Small CI workflow to test if mkdocs documentation can be successfully built.
name: test-docs
on:
workflow_dispatch:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pre_job:
runs-on: ubuntu-latest