Skip to content

Commit

Permalink
Skip duplicate workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
siad007 authored Dec 21, 2020
1 parent ba7badf commit 8bb3b37
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,28 @@ name: Phing CI

on:
push:
pull_request_target:
pull_request:

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", "**/docs/**"]'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'

static_code_analysis:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -21,7 +38,9 @@ jobs:

test:
needs:
- pre_job
- static_code_analysis
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: true
Expand Down Expand Up @@ -58,7 +77,9 @@ jobs:
build_phar:
runs-on: ubuntu-latest
needs:
- pre_job
- test
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
steps:
- uses: actions/checkout@v2
name: Checkout repository
Expand Down Expand Up @@ -93,7 +114,9 @@ jobs:
coverage:
runs-on: ubuntu-latest
needs:
- pre_job
- static_code_analysis
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down

0 comments on commit 8bb3b37

Please sign in to comment.