name: ci
"on":
push:
branches:
- main
- test-me-*
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
defaults:
run:
shell: bash
env:
LANG: en_US.utf-8
LC_ALL: en_US.utf-8
PYTHONIOENCODING: UTF-8
PYTHONWARNDEFAULTENCODING: "1"
PYTHON_VERSIONS: ""
jobs:
changes:
runs-on: blacksmith-4vcpu-ubuntu-2404
permissions:
pull-requests: read
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
src:
- 'src/**'
- 'tests/**'
- 'pyproject.toml'
- 'uv.lock'
- 'docs/**'
- 'zensical.toml'
- '*.md'
links:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Check links
uses: lycheeverse/lychee-action@v2
with:
fail: true
args: --config .lychee.toml --no-progress .
prek:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v6
with:
lfs: true
- uses: astral-sh/setup-uv@v7
with:
python-version: "3.14"
enable-cache: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: j178/prek-action@v1
env:
SKIP: no-commit-to-branch,pytest-testmon,lychee
with:
extra-args: '--all-files'
quality:
needs: changes
if: ${{ github.event_name == 'push' || needs.changes.outputs.src == 'true' }}
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
lfs: true
- name: Setup uv and Python
uses: astral-sh/setup-uv@v7
with:
python-version: "3.14"
enable-cache: true
cache-dependency-glob: pyproject.toml
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: uv run poe setup
- name: Check if the documentation builds correctly
run: |
mkdir -p htmlcov
echo '<html><body>No coverage report yet</body></html>' > htmlcov/index.html
uv run poe docs-build
- name: Store objects inventory for tests
uses: actions/upload-artifact@v6
with:
name: objects.inv
path: site/objects.inv
tests:
needs:
- prek
- quality
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
lfs: true
- name: Setup uv and Python
uses: astral-sh/setup-uv@v7
with:
python-version: "3.14"
enable-cache: true
cache-dependency-glob: pyproject.toml
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: uv run poe setup
- name: Download objects inventory
uses: actions/download-artifact@v7
with:
name: objects.inv
path: site/
- name: Run the test suite
run: uv run poe test-cov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
ci-pass:
if: always()
needs: [links, prek, quality, tests]
runs-on: ubuntu-latest
steps:
- name: Check all jobs passed
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
allowed-skips: quality, tests
jobs: ${{ toJSON(needs) }}