Skip to content

Commit

Permalink
feat(GITHUB): standardize workflow needs clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
niall-byrne committed Mar 20, 2024
1 parent 1d4419d commit be98756
Show file tree
Hide file tree
Showing 9 changed files with 190 additions and 62 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/workflow-ansible-role-molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ jobs:
WORKFLOW_NAME: "ansible"

markdown_links:
needs: [configuration]
needs:
- configuration
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-30-generic-markdown_links.yml
Expand All @@ -45,7 +46,8 @@ jobs:
VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA)._GITHUB_CI_DEFAULT_VERBOSE_NOTIFICATIONS }}

ansible_lint:
needs: [configuration]
needs:
- configuration
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-40-cookiecutter-ansible_lint.yml
Expand All @@ -58,7 +60,9 @@ jobs:
WORKFLOW_NAME: "ansible"

molecule_test:
needs: [configuration, ansible_lint]
needs:
- configuration
- ansible_lint
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-40-cookiecutter-molecule_command.yml
Expand All @@ -72,7 +76,11 @@ jobs:
WORKFLOW_NAME: "ansible"

success:
needs: [configuration, markdown_links, molecule_test, start]
needs:
- configuration
- markdown_links
- molecule_test
- start
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-00-generic-notification.yml
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/workflow-compose-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ jobs:
WORKFLOW_NAME: "compose"

compose_commands:
needs: [configuration]
needs:
- configuration
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-40-compose-run_cached_commands.yml
Expand All @@ -50,7 +51,10 @@ jobs:
WORKFLOW_NAME: "compose"

success:
needs: [configuration, compose_commands, start]
needs:
- configuration
- compose_commands
- start
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-00-generic-notification.yml
Expand Down
23 changes: 17 additions & 6 deletions .github/workflows/workflow-container-multiarch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ jobs:
WORKFLOW_NAME: "container"

security:
needs: [configuration]
needs:
- configuration
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-10-generic-security_scan_credentials.yml
Expand All @@ -44,7 +45,8 @@ jobs:
scan:
permissions:
security-events: write
needs: [configuration]
needs:
- configuration
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
strategy:
Expand Down Expand Up @@ -77,7 +79,8 @@ jobs:
WORKFLOW_NAME: "container"

lint:
needs: [configuration]
needs:
- configuration
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-80-container-dockerfile_linter.yml
Expand All @@ -87,7 +90,12 @@ jobs:
WORKFLOW_NAME: "container"

push:
needs: [configuration, lint, scan, security, start]
needs:
- configuration
- lint
- scan
- security
- start
permissions:
packages: write
secrets:
Expand Down Expand Up @@ -122,7 +130,9 @@ jobs:
WORKFLOW_NAME: "container"

multiarch:
needs: [configuration, push]
needs:
- configuration
- push
permissions:
packages: write
secrets:
Expand All @@ -139,7 +149,8 @@ jobs:
WORKFLOW_NAME: "container"

success:
needs: [multiarch]
needs:
- multiarch
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-00-generic-notification.yml
Expand Down
58 changes: 44 additions & 14 deletions .github/workflows/workflow-cookiecutter-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ jobs:
WORKFLOW_NAME: "cookiecutter"

security:
needs: [configuration]
needs:
- configuration
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-10-generic-security_scan_credentials.yml
Expand All @@ -36,7 +37,8 @@ jobs:
WORKFLOW_NAME: "cookiecutter"

markdown_links:
needs: [configuration]
needs:
- configuration
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-30-cookiecutter-markdown_links.yml
Expand All @@ -48,7 +50,8 @@ jobs:
WORKFLOW_NAME: "cookiecutter"

pre-commit_hooks:
needs: [configuration]
needs:
- configuration
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-50-cookiecutter-test_precommit_hooks.yml
Expand All @@ -61,7 +64,8 @@ jobs:
WORKFLOW_NAME: "cookiecutter"

commitizen_hooks:
needs: [configuration]
needs:
- configuration
if: startsWith(github.ref, 'refs/heads')
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
Expand All @@ -75,7 +79,8 @@ jobs:
WORKFLOW_NAME: "cookiecutter"

commit_lint:
needs: [configuration]
needs:
- configuration
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-80-poetry-rev_range_command.yml
Expand All @@ -89,7 +94,8 @@ jobs:
WORKFLOW_NAME: "cookiecutter"

commit_spell_check:
needs: [configuration]
needs:
- configuration
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-80-poetry-rev_range_command.yml
Expand All @@ -106,7 +112,8 @@ jobs:
WORKFLOW_NAME: "cookiecutter"

json_metaschema_lint:
needs: [configuration]
needs:
- configuration
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-80-poetry-precommit_commit_stage_hook.yml
Expand All @@ -119,7 +126,8 @@ jobs:
WORKFLOW_NAME: "cookiecutter"

json_schema_lint:
needs: [configuration]
needs:
- configuration
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-80-poetry-precommit_commit_stage_hook.yml
Expand Down Expand Up @@ -159,7 +167,8 @@ jobs:
WORKFLOW_NAME: "cookiecutter"

shell_lint:
needs: [configuration]
needs:
- configuration
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
strategy:
Expand All @@ -181,7 +190,8 @@ jobs:
WORKFLOW_NAME: "cookiecutter"

toml_lint:
needs: [configuration]
needs:
- configuration
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-80-cookiecutter-precommit_commit_stage_hook.yml
Expand All @@ -194,7 +204,8 @@ jobs:
WORKFLOW_NAME: "cookiecutter"

workflow_lint:
needs: [configuration]
needs:
- configuration
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
strategy:
Expand All @@ -216,7 +227,8 @@ jobs:
WORKFLOW_NAME: "cookiecutter"

yaml_lint:
needs: [configuration]
needs:
- configuration
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-80-cookiecutter-precommit_commit_stage_hook.yml
Expand All @@ -232,7 +244,23 @@ jobs:
create_release:
permissions:
contents: write
needs: [configuration, commit_lint, commit_spell_check, commitizen_hooks, json_metaschema_lint, json_schema_lint, markdown_links, markdown_lint, markdown_spelling, pre-commit_hooks, security, shell_lint, start, toml_lint, workflow_lint, yaml_lint]
needs:
- configuration
- commit_lint
- commit_spell_check
- commitizen_hooks
- json_metaschema_lint
- json_schema_lint
- markdown_links
- markdown_lint
- markdown_spelling
- pre-commit_hooks
- security
- shell_lint
- start
- toml_lint
- workflow_lint
- yaml_lint
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-99-poetry-create_release.yml
Expand All @@ -244,7 +272,9 @@ jobs:
WORKFLOW_NAME: "cookiecutter"

success:
needs: [create_release, configuration]
needs:
- create_release
- configuration
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-00-generic-notification.yml
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/workflow-mac_maker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ jobs:
WORKFLOW_NAME: "mac_maker"

mac_maker_test:
needs: [configuration] # remote_push
needs:
- configuration # remote_push
secrets:
REMOTE_ORIGIN: "osx-provisioner/profile-example"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
Expand All @@ -50,7 +51,9 @@ jobs:
WORKFLOW_NAME: "mac_maker"

success:
needs: [mac_maker_test, start]
needs:
- mac_maker_test
- start
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-00-generic-notification.yml
Expand Down
Loading

0 comments on commit be98756

Please sign in to comment.