Skip to content

Draft: Refactor GitHub Actions workflows #1432

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 9 commits into from
May 25, 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
31 changes: 0 additions & 31 deletions .github/workflows/doc.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# For documentation on GitHub Actions Workflows, see:
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: Docs
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [master]

workflow_dispatch:

permissions:
contents: read

jobs:
check-docs:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for setuptools_scm to work correctly

- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
python-version: "3.13"
- name: Install the project
run: uv sync --group docs
- name: Check if the MkDocs documentation can be built
run: uv run mkdocs build -s
20 changes: 0 additions & 20 deletions .github/workflows/format.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/lint.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/mypy.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# For documentation on GitHub Actions Workflows, see:
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: Quality
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [master]

permissions:
contents: read

jobs:
quality:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for setuptools_scm to work correctly

- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
python-version: "3.13"
- name: Install the project
run: uv sync --group quality
- name: Run pre-commit
run: uv run pre-commit run -a --show-diff-on-failure
27 changes: 18 additions & 9 deletions .github/workflows/build.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
# For documentation on GitHub Actions Workflows, see:
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: "build"

on: [push, pull_request]
name: Tests
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [master]

jobs:
build:
tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev"]
fail-fast: false

runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4 # https://github.com/actions/checkout
- name: Check out
uses: actions/checkout@v4
with:
# Only a single commit is fetched by default, for the ref/SHA that triggered the workflow.
# Set fetch-depth: 0 to fetch all history for all branches and tags.
fetch-depth: 0 # Needed for setuptools_scm to work correctly
- name: Install uv
uses: astral-sh/setup-uv@v6
Expand All @@ -26,7 +32,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Install the project
run: uv sync --all-extras --dev

Expand All @@ -35,3 +40,7 @@ jobs:

- name: Run isolated tests
run: uv run inv pytest --junit --no-pty --isolated

- name: Upload coverage reports to Codecov with GitHub Action on Python 3.13 for each OS
uses: codecov/codecov-action@v3
if: ${{ matrix.python-version == '3.13' }}
35 changes: 35 additions & 0 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# For documentation on GitHub Actions Workflows, see:
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: TypeCheck
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [master]

permissions:
contents: read

jobs:
type-check:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
fail-fast: false
defaults:
run:
shell: bash
steps:
- name: Check out
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for setuptools_scm to work correctly

- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}

- name: Check typing
run: uv run mypy .
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ docs = [
"setuptools_scm>=8",
]
plugins = ["cmd2-ext-test"]
quality = ["pre-commit>=2.20.0"]
test = [
"codecov>=2",
"coverage>=7",
Expand Down
Loading