Skip to content

Commit

Permalink
Update CI (#88)
Browse files Browse the repository at this point in the history
* Disable typing-linting on push to master

* Disallow pushing to master

* Rearrange labels

* Execute pre-commit hooks one by one

* Add issue and pr auto-locking

* Add stale

---------

Co-authored-by: tb1337 <[email protected]>
  • Loading branch information
tb1337 and tb1337 authored Feb 9, 2024
1 parent c17d91c commit 2df0b84
Show file tree
Hide file tree
Showing 10 changed files with 141 additions and 37 deletions.
8 changes: 6 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ updates:
schedule:
interval: daily
labels:
- chore
- dependencies
- auto
- no-stale
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: weekly
labels:
- chore
- dependencies
- auto
- no-stale
5 changes: 4 additions & 1 deletion .github/labels.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
- name: "auto"
color: bfdadc
description: "Marks a PR or issue that has been created automatically."
- name: "breaking-change"
color: ee0701
description: "A breaking change for existing users."
Expand Down Expand Up @@ -38,7 +41,7 @@
description: "There has not been activity on this issue or PR for quite some time."
- name: "no-stale"
color: fef2c0
description: "This issue or PR is exempted from the stable bot."
description: "This issue or PR is exempted from the stale bot."

- name: "security"
color: ee0701
Expand Down
58 changes: 37 additions & 21 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,54 @@
---
name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.

categories:
- title: '🚀 Features'
- title: '🚨 Breaking changes'
labels:
- 'enhancement'
- 'refactor'
- 'breaking-change'
- title: '✨ New features'
labels:
- 'new-feature'
- title: '🐛 Bug Fixes'
labels:
- 'bug'
- 'bugfix'
- title: '🚀 Enhancements'
labels:
- 'enhancement'
- 'refactor'
- 'performance'
- title: '🧰 Maintenance'
label: 'chore'
template: |
## Changes
labels:
- 'maintenance'
- 'ci'
- title: '📚 Documentation'
labels:
- 'documentation'
- title: '⬆️ Dependency updates'
labels:
- 'dependencies'

$CHANGES
version-resolver:
major:
labels:
- 'breaking change'
- 'major'
- 'breaking-change'
minor:
labels:
- 'minor'
- 'new-feature'
patch:
labels:
- 'bugfix'
- 'dependencies'
- 'enhancement'
- 'performance'
- 'refactor'
default: patch
autolabeler:
- label: 'bug'
branch:
- '/fix\/.+/'
title:
- '/fix/i'
- label: 'enhancement'
branch:
- '/feature\/.+/'
- label: 'chore'
branch:
- '/chore\/.+/'

template: |
## Changes
$CHANGES
20 changes: 20 additions & 0 deletions .github/workflows/lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Lock

on:
schedule:
- cron: "0 5 * * *"
workflow_dispatch:

jobs:
lock:
name: 🔒 Lock closed issues and PRs
runs-on: ubuntu-latest
steps:
- uses: dessant/[email protected]
with:
github-token: ${{ github.token }}
issue-inactive-days: "30"
issue-lock-reason: ""
pr-inactive-days: "1"
pr-lock-reason: ""
19 changes: 12 additions & 7 deletions .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,28 @@
name: PR Labels

on:
pull_request:
pull_request_target:
types:
- opened
- synchronize
- labeled
- unlabeled
branches:
- master

permissions: {}
workflow_call:

jobs:
pr_labels:
pr-labels:
name: Verify
runs-on: ubuntu-latest
steps:
- name: 🏷 Verify valid PR label
uses: ludeeus/[email protected]
with:
labels: >-
breaking-change, bugfix, chore, dependencies, documentation, enhancement, new-feature, refactor
breaking-change, bugfix,
ci,
dependencies, documentation,
enhancement,
maintenance,
new-feature,
performance,
refactor
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
body: |
Update versions of tools in pre-commit
configs to latest version
labels: dependencies
labels: dependencies, auto, no-stale
10 changes: 6 additions & 4 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Utilize release drafter action

---
name: Release Drafter

on:
push:
branches:
- master
workflow_dispatch:


jobs:
update_release_draft:
name: 📝 Draft release
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/[email protected]
- name: 🚀 Run Release Drafter
uses: release-drafter/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Stale

on:
schedule:
- cron: "0 3 * * *"
workflow_dispatch:

jobs:
stale:
name: 🧹 Clean up stale issues and PRs
runs-on: ubuntu-latest
steps:
- name: 🚀 Run stale
uses: actions/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 14
days-before-close: 7
remove-stale-when-updated: true
stale-issue-label: "stale"
exempt-issue-labels: "no-stale,help-wanted"
stale-issue-message: >
There hasn't been any activity on this issue recently, so we
clean up some of the older and inactive issues.
Please make sure to update to the latest version and
check if that solves the issue. Let us know if that works for you
by leaving a comment 👍
This issue has now been marked as stale and will be closed if no
further activity occurs. Thanks!
stale-pr-label: "stale"
exempt-pr-labels: "no-stale"
stale-pr-message: >
There hasn't been any activity on this pull request recently. This
pull request has been automatically marked as stale because of that
and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.
15 changes: 14 additions & 1 deletion .github/workflows/typing-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,17 @@ jobs:
- name: 🚧 Install dependencies
run: pip install . .[test]
- name: 🚀 Run pre-commit hooks
run: pre-commit run --all --all-files
run: |
pre-commit run check-yaml --all-files
pre-commit run check-toml --all-files
pre-commit run check-ast --all-files
pre-commit run check-docstring-first --all-files
pre-commit run debug-statements --all-files
pre-commit run end-of-file-fixer --all-files
pre-commit run trailing-whitespace --all-files
pre-commit run ruff --all-files
pre-commit run ruff-format --all-files
pre-commit run black --all-files
pre-commit run codespell --all-files
pre-commit run mypy --all-files
pre-commit run pylint --all-files
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ repos:
name: ⮐ Trailing whitespace
- id: no-commit-to-branch
name: 🛑 No commit to master branch
args:
- --branch=master
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.2.1
hooks:
Expand Down

0 comments on commit 2df0b84

Please sign in to comment.