workflows: Don't run Rust workflow again for same files

This commit is contained in:
Valentin Tolmer 2021-11-29 09:37:47 +01:00 committed by nitnelave
parent f152a78cb6
commit 2bbfacf755

View File

@ -10,8 +10,25 @@ env:
CARGO_TERM_COLOR: always
jobs:
pre_job:
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
# All of these options are optional, so you can remove them if you are happy with the defaults
concurrent_skipping: 'never'
skip_after_successful_duplicate: 'true'
paths_ignore: '["**/README.md"]'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
test:
name: cargo test
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
@ -30,6 +47,8 @@ jobs:
clippy:
name: cargo clippy
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout sources
@ -53,6 +72,8 @@ jobs:
format:
name: cargo fmt
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout sources
@ -76,6 +97,8 @@ jobs:
coverage:
name: Code coverage
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout sources