initial commit
Code Quality Pipeline / code-quality (push) Failing after 1m49s
Test Python Package / test (push) Failing after 16s
Dependency Update Bot / update-check (push) Failing after 2m4s
Security Audit / safety (push) Failing after 1m26s

This commit is contained in:
Brian Bjarke Jensen
2025-08-31 17:50:04 +02:00
parent 56cad428b0
commit c789e33290
12 changed files with 1295 additions and 1 deletions
+44
View File
@@ -0,0 +1,44 @@
name: Code Quality Pipeline
on:
push:
branches:
- main
pull_request:
jobs:
code-quality:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Install uv
run: pip install uv
- name: Install dependencies
env:
UV_LINK_MODE: copy
run: uv sync
- name: Type check with mypy
run: uv run mypy .
- name: Ruff lint
run: uv run ruff check .
- name: Ruff format
run: uv run ruff format --check .
- name: Pyupgrade check
run: uv run pyupgrade --py313-plus $(git ls-files '*.py') && git diff --exit-code
- name: Prettier format
run: |
npm install --save-dev --save-exact prettier
npx prettier --check .
@@ -0,0 +1,36 @@
name: Dependency Update Bot
on:
schedule:
- cron: "0 3 * * 1" # Every Monday at 03:00 UTC
workflow_dispatch:
jobs:
update-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Install uv and pip-review
run: |
pip install uv pip-review
- name: Update dependencies in pyproject.toml
run: |
uv pip update --all --group dev
uv pip compile --all
- name: Commit and push changes
uses: peter-evans/create-pull-request@v6
with:
commit-message: "chore(deps): update dependencies [automated]"
branch: "renovate/auto-deps-update"
title: "chore(deps): update dependencies"
body: "This PR was created automatically to update dependencies."
token: ${{ secrets.CI_RUNNER_TOKEN }}
+42
View File
@@ -0,0 +1,42 @@
# Gitea Actions workflow to build and publish Python package to Gitea Package Registry
name: Publish Python Package
on:
push:
tags:
- "v*.*.*"
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Install uv
run: pip install uv
- name: Update version in pyproject.toml to match tag
run: |
TAG_VERSION="${GITHUB_REF##*/}"
VERSION="${TAG_VERSION#v}"
sed -i.bak -E "s/^version = \".*\"/version = \"${VERSION}\"/" pyproject.toml
rm pyproject.toml.bak
- name: Build package
run: |
uv sync --no-dev
uv build
- name: Publish to Gitea Package Registry
env:
UV_PUBLISH_TOKEN: ${{ secrets.CI_RUNNER_TOKEN }}
UV_PUBLISH_URL: ${{ vars.REPOSITORY_URL }}
run: |
uv publish
+29
View File
@@ -0,0 +1,29 @@
name: Security Audit
on:
schedule:
- cron: "0 0 * * 0" # Weekly
workflow_dispatch:
jobs:
safety:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Install uv
run: pip install uv
- name: Install dependencies
env:
UV_LINK_MODE: copy
run: uv sync
- name: Run safety check
run: uv run safety check
+29
View File
@@ -0,0 +1,29 @@
name: Security Audit
on:
schedule:
- cron: "0 0 * * 0" # Weekly
workflow_dispatch:
jobs:
safety:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Install uv
run: pip install uv
- name: Install dependencies
env:
UV_LINK_MODE: copy
run: uv sync
- name: Run safety check
run: uv run safety check
@@ -0,0 +1,38 @@
name: Sync pyproject.toml Version
on:
workflow_run:
workflows: ["Publish Python Package"]
types:
- completed
jobs:
commit-version-update:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Configure git
run: |
git config user.name "CI Bot"
git config user.email "[email protected]"
- name: Update version in pyproject.toml to match tag
run: |
TAG_VERSION="${{ github.event.workflow_run.head_branch }}"
VERSION="${TAG_VERSION#v}"
sed -i.bak -E "s/^version = \".*\"/version = \"${VERSION}\"/" pyproject.toml
rm pyproject.toml.bak
- name: Commit and push changes
run: |
git add pyproject.toml
git commit -m "chore: update version in pyproject.toml to ${VERSION} [skip ci]" || echo "No changes to commit"
git push
+32
View File
@@ -0,0 +1,32 @@
name: Test Python Package
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Install uv
run: pip install uv
- name: Install dependencies
env:
UV_LINK_MODE: copy
run: uv sync
- name: Run pytest
env:
PYTHONPATH: .
run: uv run pytest