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: on:
workflow_dispatch: workflow_dispatch:
pull_request: pull_request:
paths-ignore:
- "README.md"
- "docs/**"
- ".github/ISSUE_TEMPLATE/**"
push: push:
branches: branches:
- master - master
paths-ignore:
- "README.md"
- "docs/**"
- ".github/ISSUE_TEMPLATE/**"
- "CHANGELOG.md"
- "CONTRIBUTING.md"
jobs: 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: rustfmt:
needs: pre_job
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -47,6 +51,7 @@ jobs:
- run: cargo fmt --all -- --check - run: cargo fmt --all -- --check
clippy: clippy:
needs: pre_job
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false fail-fast: false

View File

@ -1,28 +1,30 @@
# Code coverage generation via cargo-tarpaulin, and uploaded to # Code coverage generation via cargo-tarpaulin, and uploaded to codecov.
# codecov.
name: codecov name: codecov
on: on:
workflow_dispatch: workflow_dispatch:
pull_request: pull_request:
paths-ignore:
- "README.md"
- "docs/**"
- ".github/ISSUE_TEMPLATE/**"
push: push:
branches: branches:
- master - master
paths-ignore:
- "README.md"
- "docs/**"
- ".github/ISSUE_TEMPLATE/**"
- "CHANGELOG.md"
- "CONTRIBUTING.md"
jobs: jobs:
test: pre_job:
name: coverage 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 runs-on: ubuntu-latest
container: container:
image: xd009642/tarpaulin:develop image: xd009642/tarpaulin:develop