First commit

This commit is contained in:
2024-07-30 12:48:04 +02:00
parent 5583d15cda
commit f733a4c6b5
52 changed files with 541 additions and 1629 deletions

View File

@@ -1,21 +0,0 @@
files:
- ".gitignore" # include
- ".github"
- ".vscode"
- "tests/conftest.py"
- ".flake8"
- ".pre-commit-config.yml"
- ".pypirc"
- "docs"
- "src/README.md"
- "CODE_OF_CONDUCT.md"
- "LICENSE"
- "README.md"
- "SECURITY.md"
- "SUPPORT.md"
- "pyproject.toml"
- "!.github/workflows/template-sync.yml"
- "!.github/template-sync.yml"
- "!src/python_project"
- "!tests/test_methods.py"

View File

@@ -1,21 +1,20 @@
name: Python CI
name: CI
on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
release:
types: [created]
workflow_dispatch:
types: [created]
jobs:
validation:
uses: microsoft/action-python/.github/workflows/validation.yml@0.6.4
with:
workdir: '.'
tests:
uses: ./.github/workflows/tests.yml
publish:
uses: microsoft/action-python/.github/workflows/publish.yml@0.6.4
secrets:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
needs: tests
if: github.event_name == 'release'
uses: ./.github/workflows/publish.yml
permissions:
id-token: write

View File

@@ -1,10 +1,19 @@
name: Python Publish Workflow
name: Publish to PyPI
on:
workflow_call:
jobs:
publish:
uses: microsoft/action-python/.github/workflows/publish.yml@0.6.4
secrets:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
runs-on: ubuntu-latest
permissions:
id-token: write
environment: release
steps:
- uses: actions/checkout@v3
- name: Setup PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: '3.12'
- name: Build and publish to PyPI
run: pdm publish

View File

@@ -1,25 +0,0 @@
name: GitHub Actions Version Updater
# Controls when the action will run.
on:
workflow_dispatch:
schedule:
# Automatically run on every Sunday
- cron: '0 0 * * 0'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.2
with:
# [Required] Access token with `workflow` scope.
token: ${{ secrets.PAT }}
- name: Run GitHub Actions Version Updater
uses: saadmk11/github-actions-version-updater@v0.7.4
with:
# [Required] Access token with `workflow` scope.
token: ${{ secrets.PAT }}
pull_request_title: "ci: Update GitHub Actions to Latest Version"

View File

@@ -1,17 +0,0 @@
name: "Semantic PR Check"
on:
pull_request_target:
types:
- opened
- edited
- synchronize
jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,18 +0,0 @@
name: Deploy Sphinx documentation to Pages
on:
push:
branches: [main] # branch to trigger deployment
jobs:
pages:
runs-on: ubuntu-20.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- id: deployment
uses: sphinx-notes/pages@v3

View File

@@ -1,12 +0,0 @@
name: Template Sync
on:
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.2 # important!
- uses: euphoricsystems/action-sync-template-repository@v2.5.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
dry-run: true

24
.github/workflows/tests.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: Tests
on:
workflow_call:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11', '3.12']
steps:
- uses: actions/checkout@v3
- name: Setup PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: ${{ matrix.python-version }}
cache: true
- name: Install dependencies
run: pdm install --no-lock --dev
- name: Run Ruff
run: pdm run ruff check .
- name: Run Pyright
run: pdm run basedpyright