ci: skip duplicate runs (#610)

Skips duplicate runs in the CI/codecov pipelines.
This commit is contained in:
Clement Tsang 2021-11-27 04:54:55 -05:00 committed by GitHub
parent bc22c5f160
commit 4e083d4a86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 24 deletions

View File

@ -9,22 +9,26 @@ name: ci
on:
workflow_dispatch:
pull_request:
paths-ignore:
- "README.md"
- "docs/**"
- ".github/ISSUE_TEMPLATE/**"
push:
branches:
- master
paths-ignore:
- "README.md"
- "docs/**"
- ".github/ISSUE_TEMPLATE/**"
- "CHANGELOG.md"
- "CONTRIBUTING.md"
jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: "same_content_newer"
skip_after_successful_duplicate: "true"
paths_ignore: '["**/README.md", "**/docs/**", ".github/ISSUE_TEMPLATE/**", "CHANGELOG.md", "CONTRIBUTING.md"]'
do_not_skip: '["workflow_dispatch"]'
rustfmt:
needs: pre_job
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
@ -47,6 +51,7 @@ jobs:
- run: cargo fmt --all -- --check
clippy:
needs: pre_job
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false

View File

@ -1,28 +1,30 @@
# Code coverage generation via cargo-tarpaulin, and uploaded to
# codecov.
# Code coverage generation via cargo-tarpaulin, and uploaded to codecov.
name: codecov
on:
workflow_dispatch:
pull_request:
paths-ignore:
- "README.md"
- "docs/**"
- ".github/ISSUE_TEMPLATE/**"
push:
branches:
- master
paths-ignore:
- "README.md"
- "docs/**"
- ".github/ISSUE_TEMPLATE/**"
- "CHANGELOG.md"
- "CONTRIBUTING.md"
jobs:
test:
name: coverage
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: "same_content_newer"
skip_after_successful_duplicate: "true"
paths_ignore: '["**/README.md", "**/docs/**", ".github/ISSUE_TEMPLATE/**", "CHANGELOG.md", "CONTRIBUTING.md"]'
do_not_skip: '["workflow_dispatch"]'
coverage:
needs: pre_job
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:develop