Skip to content

Commit

Permalink
Cleanup workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
TGWolf committed Dec 21, 2023
1 parent 80df880 commit 843c770
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 81 deletions.
113 changes: 36 additions & 77 deletions .github/workflows/cicd-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,111 +4,70 @@ on:
push:
branches:
- '**'
paths-ignore:
- '**.md'
pull_request:
branches:
- '**'
paths-ignore:
- '**.md'
workflow_dispatch:
inputs:
slack-notify:
description: 'Notify Slack'
required: true
default: 'true'
type: choice
options:
- 'true'
- 'false'

env:
SLACK_NOTIFY: true

permissions: read-all

jobs:
bandit:
name: Bandit
uses: actionstoolbox/reusable-workflows/reusable-workflows/bandit.yml@main
uses: WolfSoftware/reusable-workflows/.github/workflows/reusable-bandit.yml@master

runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Set up Python 3.11
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: "3.11"
- name: Run Bandit
env:
EXCLUDE_FILES: '\.md$'
run: bash <(curl -s https://github.com/raw/CICDToolbox/bandit/master/pipeline.sh)
pycodestyle:
name: Pycodestyle
uses: WolfSoftware/reusable-workflows/.github/workflows/reusable-pycodestyle.yml@master

pydocstyle:
name: Pydocstyle
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Set up Python 3.11
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: "3.11"
- name: Run Pydocstyle
run: bash <(curl -s https://github.com/raw/CICDToolbox/pydocstyle/master/pipeline.sh)

pycodestyle:
name: Pycodestyle
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Set up Python 3.11
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: "3.11"
- name: Run Pycodestyle
env:
EXCLUDE_FILES: '\.md$'
run: bash <(curl -s https://github.com/raw/CICDToolbox/pycodestyle/master/pipeline.sh)
uses: WolfSoftware/reusable-workflows/.github/workflows/reusable-pydocstyle.yml@master

pylama:
name: Pylama
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Set up Python 3.11
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: "3.11"
- name: Run Pylama
run: bash <(curl -s https://github.com/raw/CICDToolbox/pylama/master/pipeline.sh)
uses: WolfSoftware/reusable-workflows/.github/workflows/reusable-pylama.yml@master

pylint:
name: Pylint
uses: WolfSoftware/reusable-workflows/.github/workflows/reusable-pylint.yml@master

set-slack-notify:
name: Set Slack Notify
runs-on: ubuntu-latest
outputs:
slack-notify: ${{ steps.set-slack-notify.outputs.slack-notify }}
steps:
- name: Checkout the repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Set up Python 3.11
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: "3.11"
- name: Run Pylint
env:
EXCLUDE_FILES: '\.md$,setup.py'
run: bash <(curl -s https://github.com/raw/CICDToolbox/pylint/master/pipeline.sh)
- name: Set Slack Notify
id: set-slack-notify
run: |
echo "slack-notify=${{ github.event.inputs.slack-notify || env.SLACK_NOTIFY }}" >> "${GITHUB_OUTPUT}"
slack-workflow-status:
if: always() && ${{ github.actor != 'dependabot[bot]' }}
if: always() && github.actor != 'dependabot[bot]'
name: Slack Post Workflow Notification
needs:
- bandit
- pydocstyle
- pycodestyle
- pydocstyle
- pylama
- pylint
runs-on: ubuntu-latest
steps:
- name: Slack Workflow Notifications
if: ${{ env.SLACK_NOTIFY == 'true' && github.event_name == 'push' }}
uses: Gamesight/slack-workflow-status@26a36836c887f260477432e4314ec3490a84f309 # v1.2.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
include_jobs: on-failure
include_commit_message: true
#
# End of Template (part 2)
#
- set-slack-notify
uses: WolfSoftware/reusable-workflows/.github/workflows/reusable-slack.yml@master
with:
slack_notify: ${{ needs.set-slack-notify.outputs.slack-notify }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
uses: github/codeql-action/analyze@421a1b344fb0def373a0794a4051f19f207461ec # v2.2.1

slack-workflow-status:
if: always() && ${{ github.actor != 'dependabot[bot]' }}
if: always() && github.actor != 'dependabot[bot]'
name: Slack Post Workflow Notification
needs:
- analyze
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
pr-message: "Thank you for raising your first pull request - all contributions to this project are welcome!"

slack-workflow-status:
if: always() && ${{ github.actor != 'dependabot[bot]' }}
if: always() && github.actor != 'dependabot[bot]'
name: Slack Post Workflow Notification
needs:
- greeting
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/repo-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
run: bash <(curl -s https://github.com/raw/CICDToolbox/yaml-lint/master/pipeline.sh)

slack-workflow-status:
if: always() && ${{ github.actor != 'dependabot[bot]' }}
if: always() && github.actor != 'dependabot[bot]'
name: Slack Post Workflow Notification
needs:
- actionlint
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@f32435541e24cd6a4700a7f52bb2ec59e80603b1 # v2.1.4

slack-workflow-status:
if: always() && ${{ github.actor != 'dependabot[bot]' }}
if: always() && github.actor != 'dependabot[bot]'
name: Slack Post Workflow Notification
needs:
- harden_security
Expand Down

0 comments on commit 843c770

Please sign in to comment.