🎉 Initial commit

This commit is contained in:
2025-03-08 18:16:37 +01:00
parent 51d66dd06b
commit 803f6798a6
10 changed files with 960 additions and 0 deletions

25
.github/workflows/CI.yaml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: CI
on:
push:
branches: [ "main", "dev" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: ["main", "dev"]
release:
types: [created]
jobs:
quality:
uses: ./.github/workflows/quality.yaml
permissions:
contents: read
publish:
needs: quality
if: github.event_name == 'release'
uses: ./.github/workflows/publish.yaml
permissions:
id-token: write
contents: read

31
.github/workflows/publish.yaml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Quality Checks
on:
workflow_call:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Install uv"
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Install dependencies
run: uv sync
- name: Build
run: uv build
- name: Publish
run: uv publish

51
.github/workflows/quality.yaml vendored Normal file
View File

@@ -0,0 +1,51 @@
name: Quality Checks
on:
workflow_call:
jobs:
check-license-header:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Copywrite
uses: hashicorp/setup-copywrite@5e3e8a26d7b9f8a508848ad0a069dfd2f7aa5339
- name: Check Header Compliance
run: copywrite headers --plan --config .copywrite.hcl
quality:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
check: [format, lint]
include:
- check: format
name: "Format Check"
command: "uv run ruff format --check ."
- check: lint
name: "Lint Check"
command: "uv run ruff check ."
name: ${{ matrix.name }}
steps:
- uses: actions/checkout@v4
- name: "Install uv"
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Install dependencies
run: uv sync
- name: ${{ matrix.name }}
run: ${{ matrix.command }}