Skip to content
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
15 changes: 15 additions & 0 deletions .github/actions/cache-uv/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Cache uv dependencies
description: Share package downloads and built wheels between uv jobs.
inputs:
suffix:
description: Cache namespace and Python version.
required: true
runs:
using: composite
steps:
- uses: actions/cache@v5
with:
path: .uv-cache
key: uv-0.13.9-${{ runner.os }}-${{ runner.arch }}-${{ inputs.suffix }}-${{ hashFiles('uv.lock') }}
- shell: bash
run: echo "UV_CACHE_DIR=.uv-cache" >> "$GITHUB_ENV"
41 changes: 41 additions & 0 deletions .github/actions/run-uv/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Run in the Astral uv image
description: Run a project command with the runner workspace and temporary directory mounted.
inputs:
command:
description: Bash commands to run in the image.
required: true
testcontainers:
description: Give the test process access to the runner's Docker daemon.
default: "false"
runs:
using: composite
steps:
- shell: bash
env:
UV_COMMAND: ${{ inputs.command }}
USE_TESTCONTAINERS: ${{ inputs.testcontainers }}
run: |
args=(
--rm --init
--user "$(id -u):$(id -g)"
--mount "type=bind,src=$GITHUB_WORKSPACE,dst=$GITHUB_WORKSPACE"
--mount "type=bind,src=$RUNNER_TEMP,dst=$RUNNER_TEMP"
--workdir "$GITHUB_WORKSPACE"
# Temporal's Go CLI needs a username when the runner UID has no container passwd entry.
--env USER="$(id -un)"
--env TMPDIR="$RUNNER_TEMP"
--env UV_PYTHON_INSTALL_DIR="$RUNNER_TEMP/uv-python"
--env UV_PYTHON --env UV_CACHE_DIR --env EXPECTED_PYTHON
--env GITHUB_STEP_SUMMARY
)
if [[ "$USE_TESTCONTAINERS" == "true" ]]; then
# Redis and Kafka advertise localhost. The Docker daemon also needs to see temporary fixture files.
args+=(
--network host
--group-add "$(stat -c %g /var/run/docker.sock)"
--mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock
--env TESTCONTAINERS_CONNECTION_MODE=docker_host --env TESTCONTAINERS_HOST_OVERRIDE=127.0.0.1
--env BEHAVE_JOBS --env BEHAVE_HEAVY_JOBS --env FEATURES --env EXCLUDED_FEATURES
)
fi
docker run "${args[@]}" ghcr.io/astral-sh/uv:0.13.9-trixie bash -ec "$UV_COMMAND"
23 changes: 9 additions & 14 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
paths:
- 'docs/**'
- 'archipy/**'
- 'packages/**'
- 'pyproject.toml'
- 'uv.lock'
- '.python-version'
- '.github/workflows/deploy-docs.yml'

permissions:
Expand All @@ -16,35 +20,26 @@ permissions:
jobs:
deploy:
runs-on: ubuntu-latest
container: ghcr.io/astral-sh/uv:0.13.9-trixie
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0 # Fetch all history for proper versioning

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.14'

- name: Install UV
uses: astral-sh/setup-uv@v7

- name: Cache UV
- name: Cache uv dependencies
uses: actions/cache@v5
with:
path: ~/.cache/uv
key: uv-${{ runner.os }}-docs-${{ hashFiles('uv.lock') }}
key: uv-docs-deploy-${{ runner.arch }}-${{ hashFiles('.python-version', 'uv.lock') }}

- name: Install dependencies
run: |
uv sync --group docs
run: uv sync --locked --group docs

- name: Configure Git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"

- name: Deploy documentation
run: |
uv run --group docs mkdocs gh-deploy --force -f docs/mkdocs-full.yml
run: uv run --no-sync mkdocs gh-deploy --force -f docs/mkdocs-full.yml
38 changes: 27 additions & 11 deletions .github/workflows/docs-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,46 @@ on:
- 'docs/**'
- 'archipy/**'
- 'packages/**'
- 'pyproject.toml'
- 'uv.lock'
- 'Makefile'
- '.readthedocs.yaml'
- '.github/workflows/docs-check.yml'

permissions:
contents: read

jobs:
docs-check:
build:
name: docs (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
container: ghcr.io/astral-sh/uv:0.13.9-trixie
env:
UV_PYTHON: ${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
python-version: ["3.14", "3.15"]
steps:
- uses: actions/checkout@v6

- name: Set up Python 3.14
uses: actions/setup-python@v6
with:
python-version: "3.14"

- name: Install UV
uses: astral-sh/setup-uv@v7

- name: Cache UV
- name: Cache uv dependencies
uses: actions/cache@v5
with:
path: ~/.cache/uv
key: uv-${{ runner.os }}-3.14-${{ hashFiles('uv.lock') }}
key: uv-docs-${{ runner.arch }}-${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}

- name: Install dependencies
run: uv sync --locked --group docs

- name: Build the docs in strict mode
env:
UV_NO_SYNC: "true"
run: make docs-check

docs-check:
needs: build
if: always()
runs-on: ubuntu-latest
steps:
- run: test "${{ needs.build.result }}" = success
15 changes: 13 additions & 2 deletions .github/workflows/instrumentor-compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,23 @@ on:

jobs:
instrumentor-compat:
name: instrumentor compatibility (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
container: ghcr.io/astral-sh/uv:0.13.9-trixie
env:
UV_PYTHON: ${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
python-version: ["3.14", "3.15"]
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
- uses: ./.github/actions/cache-uv
with:
suffix: instrumentor-${{ matrix.python-version }}
- name: Install Python
run: uv python install "$UV_PYTHON"
- name: Check instrumentor version ranges
run: ./scripts/check_instrumentor_compat.sh
48 changes: 35 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ on:
- '[0-9]+.[0-9]+.[0-9]+'

jobs:
publish:
build:
name: build packages (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
container: ghcr.io/astral-sh/uv:0.13.9-trixie
env:
UV_PYTHON: ${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
python-version: ["3.14", "3.15"]
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.14

- name: Install UV
uses: astral-sh/setup-uv@v7

- name: Update version in pyproject.toml
run: |
# Extract version from tag
Expand All @@ -31,9 +31,31 @@ jobs:
sed -i -E "s/^version = \"[^\"]*\"/version = \"$VERSION\"/; s/\"archipy(-[a-z-]+)?(\[[a-z]+\])?==[^\"]*\"/\"archipy\1\2==$VERSION\"/" "$f"
done

- name: Build and Publish to PyPI
- name: Build distributions
run: uv build --all-packages --python "$UV_PYTHON"

- name: Upload distributions for publishing
if: matrix.python-version == '3.14'
uses: actions/upload-artifact@v4
with:
name: distributions
path: |
dist/*.whl
dist/*.tar.gz
if-no-files-found: error

publish:
needs: build
runs-on: ubuntu-latest
container: ghcr.io/astral-sh/uv:0.13.9-trixie
steps:
- name: Download distributions
uses: actions/download-artifact@v5
with:
name: distributions
path: dist

- name: Publish to PyPI
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
uv build --all-packages
uv publish
run: uv publish
57 changes: 35 additions & 22 deletions .github/workflows/ruff-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,54 @@ permissions:
contents: read

jobs:
lint:
ruff:
name: Ruff (${{ matrix.target-version }})
runs-on: ubuntu-latest
container: ghcr.io/astral-sh/uv:0.13.9-trixie
strategy:
fail-fast: false
matrix:
target-version: ["py314", "py315"]
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Install lint tools
run: uv sync --locked --only-group dev

- name: Run Ruff check
uses: astral-sh/ruff-action@v3
with:
args: check --output-format=github
src: "archipy packages features/steps scripts"
run: uv run --no-sync ruff check --no-fix --output-format=github --target-version ${{ matrix.target-version }} archipy packages features/steps scripts

- name: Run Ruff format check
uses: astral-sh/ruff-action@v3
with:
args: format --check
src: "archipy packages features/steps scripts"
run: uv run --no-sync ruff format --check --target-version ${{ matrix.target-version }} archipy packages features/steps scripts

- name: Set up Python 3.14
uses: actions/setup-python@v6
with:
python-version: "3.14"

- name: Install UV
uses: astral-sh/setup-uv@v7
gherkin:
name: gherkin (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
container: ghcr.io/astral-sh/uv:0.13.9-trixie
env:
UV_PYTHON: ${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
python-version: ["3.14", "3.15"]
steps:
- uses: actions/checkout@v6

- name: Cache UV
uses: actions/cache@v5
- uses: ./.github/actions/cache-uv
with:
path: ~/.cache/uv
key: uv-${{ runner.os }}-3.14-${{ hashFiles('uv.lock') }}
suffix: gherkin-${{ matrix.python-version }}

- name: Install dependencies
run: uv sync --group dev --frozen
run: uv sync --locked --group dev

- name: Run Gherkin format check
run: uv run gherkin-formatter --check features/
run: uv run --no-sync gherkin-formatter --check features/

lint:
needs: [ruff, gherkin]
if: always()
runs-on: ubuntu-latest
steps:
- run: test "${{ needs.ruff.result }}" = success && test "${{ needs.gherkin.result }}" = success
Loading
Loading