-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
180 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Set update schedule for GitHub Actions | ||
|
||
version: 2 | ||
updates: | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
# Check for updates to GitHub Actions every weekday | ||
interval: "daily" | ||
|
||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
# Check for updates to GitHub Actions every weekday | ||
interval: "daily" |
73 changes: 39 additions & 34 deletions
73
.github/workflows/pipeline.yml → .github/workflows/cicd-pipeline.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,97 +1,102 @@ | ||
name: pipeline | ||
name: CICD Pipeline | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
bandit: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: [ '3.6', '3.7', '3.8', '3.9' ] | ||
python: [ '3.7', '3.8', '3.9', '3.10' ] | ||
name: Bandit Test on Python ${{ matrix.python }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Run Bandit | ||
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/bandit/master/pipeline.sh) | ||
pur: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: [ '3.6', '3.7', '3.8', '3.9' ] | ||
name: Pur Test on Python ${{ matrix.python }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Run Pur | ||
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/pur/master/pipeline.sh) | ||
# pur: | ||
# runs-on: ubuntu-latest | ||
# strategy: | ||
# matrix: | ||
# python: [ '3.7', '3.8', '3.9', '3.10' ] | ||
# name: Pur Test on Python ${{ matrix.python }} | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - name: Set up Python ${{ matrix.python }} | ||
# uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: ${{ matrix.python }} | ||
# - name: Run Pur | ||
# run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/pur/master/pipeline.sh) | ||
pycodestyle: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: [ '3.6', '3.7', '3.8', '3.9' ] | ||
python: [ '3.7', '3.8', '3.9', '3.10' ] | ||
name: Pycodestyle Test on Python ${{ matrix.python }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Run Pycodestyle | ||
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/pycodestyle/master/pipeline.sh) | ||
|
||
awesomebot: | ||
name: Awesomebot | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Ruby 3.0 | ||
- uses: actions/checkout@v3 | ||
- name: Set up Ruby 3.1 | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.0 | ||
ruby-version: 3.1 | ||
- name: Run Awesomebot | ||
env: | ||
FLAGS: "default" | ||
EXCLUDE_FILES: "CHANGELOG.md" | ||
WHITELIST: "https://img.shields.io" | ||
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/awesomebot/master/pipeline.sh) | ||
|
||
shellcheck: | ||
name: ShellCheck | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Run Shellcheck | ||
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/shellcheck/master/pipeline.sh) | ||
|
||
yaml-lint: | ||
name: YAML Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Ruby 3.0 | ||
- uses: actions/checkout@v3 | ||
- name: Set up Ruby 3.1 | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.0 | ||
ruby-version: 3.1 | ||
- name: Run YAML-Lint | ||
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/yaml-lint/master/pipeline.sh) | ||
|
||
slack-workflow-status: | ||
if: always() | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | ||
name: Slack Post Workflow Notification | ||
needs: | ||
- bandit | ||
- pur | ||
# - pur | ||
- pycodestyle | ||
- awesomebot | ||
- shellcheck | ||
- yaml-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Slack Post Workflow Notification | ||
uses: Gamesight/slack-workflow-status@master | ||
- name: Slack Workflow Notifications | ||
uses: Gamesight/slack-workflow-status@v1.1.0 | ||
with: | ||
include_jobs: true | ||
repo_token: ${{secrets.GITHUB_TOKEN}} | ||
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}} | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
include_jobs: on-failure | ||
include_commit_message: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Delete old workflow runs | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
days: | ||
description: 'Number of days.' | ||
required: true | ||
default: 30 | ||
minimum_runs: | ||
description: 'The minimum runs to keep for each workflow.' | ||
required: true | ||
default: 6 | ||
schedule: | ||
- cron: '0 4 * * *' | ||
|
||
jobs: | ||
delete_old_workflows: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set the variables | ||
env: | ||
DEFAULT_DAYS: 14 | ||
DEFAULT_MINIMUM_RUNS: 3 | ||
run: | | ||
echo "DAYS=${{ github.event.inputs.days || env.DEFAULT_DAYS }}" >> $GITHUB_ENV | ||
echo "MINIMUM_RUNS=${{ github.event.inputs.minimum_runs || env.DEFAULT_MINIMUM_RUNS }}" >> $GITHUB_ENV | ||
- name: Delete workflow runs | ||
uses: Mattraks/delete-workflow-runs@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
repository: ${{ github.repository }} | ||
retain_days: ${{ env.DAYS }} | ||
keep_minimum_runs: ${{ env.MINIMUM_RUNS }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Dependabot pull request approve and merge | ||
on: pull_request_target | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: write | ||
|
||
jobs: | ||
dependabot: | ||
runs-on: ubuntu-latest | ||
# Checking the actor will prevent your Action run failing on non-Dependabot | ||
# PRs but also ensures that it only does work for Dependabot PRs. | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
steps: | ||
# This first step will fail if there's no metadata and so the approval | ||
# will not occur. | ||
- name: Dependabot metadata | ||
id: dependabot-metadata | ||
uses: dependabot/fetch-metadata@v1.3.3 | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
# Here the PR gets approved. | ||
- name: Approve a PR | ||
run: gh pr review --approve "$PR_URL" | ||
env: | ||
PR_URL: ${{ github.event.pull_request.html_url }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Finally, this sets the PR to allow auto-merging for patch and minor | ||
# updates if all checks pass | ||
- name: Enable auto-merge for Dependabot PRs | ||
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }} | ||
run: gh pr merge --auto --squash "$PR_URL" | ||
env: | ||
PR_URL: ${{ github.event.pull_request.html_url }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Stale issue/pr handler | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 4 * * *' | ||
|
||
permissions: | ||
issues: write | ||
pull-requests: write | ||
|
||
jobs: | ||
handle-stale-entries: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/stale@v5 | ||
id: stale | ||
with: | ||
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.' | ||
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.' | ||
days-before-issue-stale: 30 | ||
days-before-issue-close: 5 | ||
stale-issue-label: 'state: stale' | ||
close-issue-label: 'resolution closed' | ||
exempt-issue-labels: 'state: blocked,state: keep' | ||
stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.' | ||
close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.' | ||
days-before-pr-stale: 45 | ||
days-before-pr-close: 10 | ||
stale-pr-label: 'state: stale' | ||
close-pr-label: 'resolution: closed' | ||
exempt-pr-labels: 'state: blocked,state: keep' | ||
- name: Print outputs | ||
run: echo ${{ join(steps.stale.outputs.*, ',') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Purge obsolete workflow runs | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 4 * * *' | ||
|
||
jobs: | ||
purge_obsolete_workflows: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: otto-contentfactory/purge-workflow-runs@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
**/.DS-Store | ||
**/ab-results* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters