Skip to content

Commit

Permalink
feat(workflows): Prevent skipped jobs from stopping downstream jobs -- 3
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusSkytte committed Oct 4, 2024
1 parent c9530b1 commit 3fc8ab8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/document.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
on:
workflow_call:
inputs:
skip:
type: boolean
default: false
branch_name:
type: string
required: true
Expand All @@ -16,7 +13,6 @@ jobs:
document:
name: 📖 Document
runs-on: ubuntu-latest
if: ${{ inputs.skip == 'false' }}

steps:
- name: Checkout repo
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/render-readme.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
on:
workflow_call:
inputs:
skip:
type: boolean
default: false
branch_name:
type: string
required: true
Expand All @@ -12,7 +9,6 @@ jobs:
render:
name: 📖 README
runs-on: ubuntu-latest
if: ${{ inputs.skip == 'false' }}

steps:
- name: Checkout repo
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/update-lockfile.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
on:
workflow_call:
inputs:
skip:
type: boolean
default: false
cache_version:
type: string
default: '1'
Expand All @@ -15,7 +12,6 @@ jobs:
update-lockfile:
name: 🛠️ Store dependency versions
runs-on: ubuntu-latest
if: ${{ inputs.skip == 'false' }}

steps:
- name: Checkout repo
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/workflow-dispatcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ jobs:
update-lockfile:
needs: trigger
uses: ./.github/workflows/update-lockfile.yaml
if: ${{ needs.trigger.outputs.update-lockfile == 'true' }}
with:
skip: ${{ needs.trigger.outputs.update-lockfile == 'false' }}
cache_version: ${{ needs.trigger.outputs.cache_version }}
branch_name: ${{ needs.trigger.outputs.branch_name }}
secrets: inherit
Expand All @@ -209,8 +209,8 @@ jobs:
document:
needs: [trigger, update-lockfile]
uses: ./.github/workflows/document.yaml
if: always() && ${{ needs.trigger.outputs.document == 'true' }}
with:
skip: ${{ needs.trigger.outputs.document == 'false' }}
branch_name: ${{ needs.trigger.outputs.branch_name }}
secrets: inherit
concurrency:
Expand All @@ -221,8 +221,8 @@ jobs:
render-readme:
needs: [trigger, update-lockfile]
uses: ./.github/workflows/render-readme.yaml
if: always() && ${{ needs.trigger.outputs.render-readme == 'true' }}
with:
skip: ${{ needs.trigger.outputs.render-readme == 'false' }}
branch_name: ${{ needs.trigger.outputs.branch_name }}
secrets: inherit
concurrency:
Expand All @@ -232,20 +232,20 @@ jobs:

lint:
needs: [trigger, update-lockfile, document, render-readme]
if: ${{ needs.trigger.outputs.lint == 'true' }}
if: always() && ${{ needs.trigger.outputs.lint == 'true' }}
uses: ./.github/workflows/lint.yaml


spell-checker:
needs: [trigger, update-lockfile, document, render-readme]
if: ${{ needs.trigger.outputs.spell-checker == 'true' }}
if: always() && ${{ needs.trigger.outputs.spell-checker == 'true' }}
uses: ./.github/workflows/spell-checker.yaml
secrets: inherit


R-CMD-check:
needs: [trigger, update-lockfile, document, render-readme]
if: ${{ needs.trigger.outputs.R-CMD-check == 'true' }}
if: always() && ${{ needs.trigger.outputs.R-CMD-check == 'true' }}
uses: ./.github/workflows/R-CMD-check.yaml
with:
rcmdcheck_args: ${{ inputs.rcmdcheck_args }}
Expand All @@ -258,7 +258,7 @@ jobs:

code-coverage:
needs: [trigger, update-lockfile, document, render-readme]
if: ${{ needs.trigger.outputs.code-coverage == 'true' }}
if: always() && ${{ needs.trigger.outputs.code-coverage == 'true' }}
uses: ./.github/workflows/code-coverage.yaml
with:
cache_version: ${{ needs.trigger.outputs.cache_version }}
Expand All @@ -273,7 +273,7 @@ jobs:

pkgdown:
needs: [trigger, update-lockfile, document, render-readme]
if: ${{ needs.trigger.outputs.pkgdown == 'true' }}
if: always() && ${{ needs.trigger.outputs.pkgdown == 'true' }}
uses: ./.github/workflows/pkgdown.yaml
with:
event_name: ${{ inputs.event_name }}
Expand Down

0 comments on commit 3fc8ab8

Please sign in to comment.