Skip to content

Renovate and migrate to reusable github workflows #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .devcontainer/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
services:
app:
entrypoint: ""
command: sleep infinity
build:
context: .
189 changes: 189 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
{
// name of the devcontainer
"name": "django-celery-token-bucket",
// define the docker compose file to use for the devcontainer
"dockerComposeFile": [
"../compose.yaml",
"./compose.yaml"
],
// define which services from the compose file to start and stop
"runServices": [
"app"
],
// define the docker-compose service to use for the dev container
"service": "app",
// define the workspace folder our app is located in
"workspaceFolder": "/app",
// set the remote user to connect as
"remoteUser": "app",
// features to be installed in the dev container
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {},
"ghcr.io/devcontainers/features/git:1": {}
},
// configure vscode
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
"settings": {
// terminal settings
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash"
}
},
"terminal.integrated.defaultProfile.linux": "bash",
// language specific editor settings
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
},
"[markdown]": {
"files.trimTrailingWhitespace": false
},
// allow tasks to run on editor startup
"task.allowAutomaticTasks": "on",
// python environment
"python.defaultInterpreterPath": "/home/app/venv/bin/python",
"python.analysis.extraPaths": [
"/home/app/venv/lib/python3.12/site-packages/"
],
"python.analysis.useImportHeuristic": true,
"python.analysis.autoSearchPaths": true,
"python.analysis.autoImportCompletions": true,
"python.analysis.indexing": true,
"python.analysis.packageIndexDepths": [
{
"name": "",
"depth": 10,
"includeAllSymbols": true
}
],
// don't activate the virtual environment every time as we're using the env binary
"python.terminal.activateEnvironment": false,
"python.terminal.activateEnvInCurrentTerminal": true,
// used for autocomplete etc
"python.languageServer": "Pylance",
// editor settings
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "always",
"source.organizeImports": "always"
},
"editor.rulers": [
88,
120
],
// shows the nested current scopes during the scroll at the top of the editor
"editor.stickyScroll.enabled": true,
// file formatting options
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.associations": {
"**/requirements{/**,*}.{txt,in}": "pip-requirements"
},
// files to exclude from search results
"search.exclude": {
"**/__pycache__": true,
"**/.bash_aliases": true,
"**/.git": true,
"**/.ipython": true,
"**/.mypy_cache": true,
"**/logs": true,
"**/node_modules": true,
"**/tmp": true
},
// files to exclude from all checks
"files.exclude": {
"**/*.pyc": true,
"**/.git": false,
"**/migrations/*": false
},
// gitlens settings
"gitlens.codeLens.enabled": false,
"gitlens.advanced.blame.customArguments": [
"--ignore-revs-file",
".git-blame-ignore-revs"
],
// copilot settings
"github.copilot.editor.enableAutoCompletions": true,
"github.copilot.enable": {
"*": true,
"plaintext": false,
"markdown": false,
"scminput": false
}
},
// list all extensions that should be installed when the container is created
"extensions": [
// ---------------------------------------
// CODING SUPPORT
// ---------------------------------------
// Visual Studio IntelliCode - AI-assisted development
// https://marketplace.visualstudio.com/items?itemName=VisualStudioExptTeam.vscodeintellicode
"visualstudioexptteam.vscodeintellicode",
// ---------------------------------------
// PYTHON
// ---------------------------------------
// Python extension for Visual Studio Code
// https://marketplace.visualstudio.com/items?itemName=ms-python.python
"ms-python.python",
// Pylance - A performant, feature-rich language server for Python in VS Code
// https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance
"ms-python.vscode-pylance",
// Python docstring generator
// https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring
"njpwerner.autodocstring",
// Proper indentation for Python
// https://marketplace.visualstudio.com/items?itemName=KevinRose.vsc-python-indent
"KevinRose.vsc-python-indent",
// Visually highlight indentation depth
// https://marketplace.visualstudio.com/items?itemName=oderwat.indent-rainbow
"oderwat.indent-rainbow",
// Code comment highlights
// https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments
"aaron-bond.better-comments",
// Linting with ruff
// https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff
// updates to the ruff vscode plugin must be in sync with github actions
"charliermarsh.ruff@2025.8.0",
// Linting with mypy
// https://marketplace.visualstudio.com/items?itemName=ms-python.mypy-type-checker
"ms-python.mypy-type-checker",
// ---------------------------------------
// GIT
// ---------------------------------------
// View git log, file history, compare branches or commits
// https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory
"donjayamanne.githistory",
// Supercharge the Git capabilities built into Visual Studio Code
// https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens
"eamodio.gitlens",
// GitLab Workflow
// https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow
"GitLab.gitlab-workflow",
// create / apply git patches
// https://marketplace.visualstudio.com/items?itemName=paragdiwan.gitpatch
"paragdiwan.gitpatch",
// ---------------------------------------
// FILE TYPE SUPPORT
// ---------------------------------------
// Support for dotenv file syntax
// https://marketplace.visualstudio.com/items?itemName=mikestead.dotenv
"mikestead.dotenv",
// Syntax highlighting for .po files
// https://marketplace.visualstudio.com/items?itemName=mrorz.language-gettext
"mrorz.language-gettext",
// Duplicate translation error marking for .po files
// https://marketplace.visualstudio.com/items?itemName=ovcharik.gettext-duplicate-error
"ovcharik.gettext-duplicate-error",
// YAML language support
// https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml
"redhat.vscode-yaml",
// TOML language support
// https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml
"tamasfe.even-better-toml"
]
}
}
}
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
45 changes: 45 additions & 0 deletions .github/workflows/build-and-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Build and publish

on:
push:
tags:
- "**"

jobs:
# build package, make release on github and upload to pypi when a new tag is pushed
# see https://github.com/RegioHelden/github-reusable-workflows/blob/main/.github/workflows/build-and-publish.yaml
build-and-release:
name: Build and publish
permissions:
contents: write
id-token: write
uses: regiohelden/github-reusable-workflows/.github/workflows/build-and-publish.yaml@main

# must be defined in the repo as trusted publishing does not work with reusable workflows yet
# see https://github.com/pypi/warehouse/issues/11096
publish-pypi:
name: Publish on PyPI
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
needs:
- build-and-release
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5

- name: Download the distribution packages
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Publish
run: uv publish --trusted-publishing always
17 changes: 17 additions & 0 deletions .github/workflows/check_pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Check pull request

on:
# when labels are added/removed or draft status gets changed to ready for review
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled, ready_for_review]

jobs:
# make sure the pull request matches our guidelines like having at least one label assigned
# see https://github.com/RegioHelden/github-reusable-workflows/blob/main/.github/workflows/check-pull-request.yaml
check-pull-request:
name: Check pull request
permissions:
issues: write
pull-requests: write
uses: RegioHelden/github-reusable-workflows/.github/workflows/check-pull-request.yaml@main
16 changes: 16 additions & 0 deletions .github/workflows/cron.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Cron actions

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

jobs:
# synchronize labels from central definition at https://github.com/RegioHelden/.github/blob/main/labels.yaml
# see https://github.com/RegioHelden/github-reusable-workflows/blob/main/.github/workflows/sync-labels.yaml
update-labels:
name: Update labels
permissions:
issues: write
uses: RegioHelden/github-reusable-workflows/.github/workflows/sync-labels.yaml@main
17 changes: 17 additions & 0 deletions .github/workflows/open-release-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Open release PR

on:
workflow_dispatch:

jobs:
# trigger creation of a release pull request with version increase and changelog update
# see https://github.com/RegioHelden/github-reusable-workflows/blob/main/.github/workflows/release-pull-request.yaml
open-release-pr:
name: Open release PR
permissions:
contents: write
pull-requests: write
uses: RegioHelden/github-reusable-workflows/.github/workflows/release-pull-request.yaml@main
secrets:
personal-access-token: "${{ secrets.COMMIT_KEY }}"
18 changes: 18 additions & 0 deletions .github/workflows/tag-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Tag release

on:
push:
branches:
- main

jobs:
# create a new git tag when a version update was merged to main branch
# see https://github.com/RegioHelden/github-reusable-workflows/blob/main/.github/workflows/tag-release.yaml
tag-release:
name: Create tag
permissions:
contents: write
uses: RegioHelden/github-reusable-workflows/.github/workflows/tag-release.yaml@main
secrets:
personal-access-token: "${{ secrets.COMMIT_KEY }}"
Loading