diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index 433dbbb7..0c3791b6 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -101,7 +101,7 @@ jobs: run: uv run python -m conformance telemetry --implementation python@main --implementation rust@main chaos: - name: Chaos tests + name: Chaos tests, python@main and python@release runs-on: ubuntu-26.04 timeout-minutes: 6 diff --git a/.github/workflows/prek.yml b/.github/workflows/prek.yml new file mode 100644 index 00000000..f2825830 --- /dev/null +++ b/.github/workflows/prek.yml @@ -0,0 +1,36 @@ +name: Prek + +on: + push: + branches: [main] + pull_request: + workflow_call: + +permissions: + contents: read + +# The hooks lint every language's files and the tools at the root, so they +# run in a workflow of their own rather than in one language's. +jobs: + prek: + name: Prek checks + runs-on: ubuntu-26.04 + timeout-minutes: 10 + steps: + - uses: actions/checkout@v7 + + - name: Install uv and set Python version + uses: astral-sh/setup-uv@v7 + with: + python-version: "3.10" + enable-cache: true + cache-dependency-glob: "uv.lock" + + - name: Install dependencies + run: uv sync + + - name: Run prek + uses: j178/prek-action@v2 + env: + # The Rust workflow runs rustfmt and clippy with its own toolchain. + SKIP: rustfmt,clippy diff --git a/.github/workflows/publish-rust.yml b/.github/workflows/publish-rust.yml index 97681a9f..41e9cead 100644 --- a/.github/workflows/publish-rust.yml +++ b/.github/workflows/publish-rust.yml @@ -14,18 +14,19 @@ jobs: if: startsWith(github.event.release.tag_name, 'rust/v') uses: ./.github/workflows/rust.yml secrets: inherit - # A called workflow can ask for no more than its caller grants, and - # GitHub refuses the whole run at startup if one of its jobs does, even - # a job that skips itself on a release. permissions: contents: read - pull-requests: read + + prek: + name: Run the Prek workflow + if: startsWith(github.event.release.tag_name, 'rust/v') + uses: ./.github/workflows/prek.yml publish: name: Publish docket-rs to crates.io runs-on: ubuntu-26.04 timeout-minutes: 15 - needs: rust + needs: [rust, prek] environment: name: crates-io url: https://crates.io/crates/docket-rs diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 078d44b5..0b8d8072 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,17 +9,22 @@ permissions: jobs: ci: - name: Run CI + name: Run the Python workflow # pydocket releases are tagged python/v0.27.0, or bare before the # monorepo. Another language's release does not publish to PyPI. if: startsWith(github.event.release.tag_name, 'python/v') || !contains(github.event.release.tag_name, '/') - uses: ./.github/workflows/ci.yml + uses: ./.github/workflows/python.yml + + prek: + name: Run the Prek workflow + if: startsWith(github.event.release.tag_name, 'python/v') || !contains(github.event.release.tag_name, '/') + uses: ./.github/workflows/prek.yml publish: name: Build and publish to PyPI runs-on: ubuntu-26.04 timeout-minutes: 10 - needs: ci + needs: [ci, prek] environment: name: pypi url: https://pypi.org/p/pydocket diff --git a/.github/workflows/ci.yml b/.github/workflows/python.yml similarity index 91% rename from .github/workflows/ci.yml rename to .github/workflows/python.yml index 9628ca5e..f1ace0d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/python.yml @@ -1,4 +1,4 @@ -name: CI +name: Python on: push: @@ -11,7 +11,7 @@ permissions: jobs: test: - name: Core, Python ${{ matrix.python-version }}, ${{ matrix.backend.name }} + name: Python ${{ matrix.python-version }}, ${{ matrix.backend.name }} runs-on: ubuntu-26.04 timeout-minutes: 5 defaults: @@ -113,7 +113,7 @@ jobs: report_type: test_results test-cli: - name: CLI, Python ${{ matrix.python-version }} + name: Python ${{ matrix.python-version }}, CLI runs-on: ubuntu-26.04 timeout-minutes: 4 defaults: @@ -165,7 +165,7 @@ jobs: report_type: test_results test-windows: - name: Windows, Python ${{ matrix.python-version }} + name: Python ${{ matrix.python-version }}, Windows runs-on: windows-latest timeout-minutes: 6 defaults: @@ -213,7 +213,7 @@ jobs: report_type: test_results test-redis-py: - name: redis-py ${{ matrix.redis-py.name }}, Python 3.14, Redis 8.10 + name: Python 3.14, Redis 8.10, redis-py ${{ matrix.redis-py.name }} runs-on: ubuntu-26.04 timeout-minutes: 4 defaults: @@ -266,26 +266,3 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} report_type: test_results - - prek: - name: Prek checks - runs-on: ubuntu-26.04 - timeout-minutes: 10 - steps: - - uses: actions/checkout@v7 - - - name: Install uv and set Python version - uses: astral-sh/setup-uv@v7 - with: - python-version: "3.10" - enable-cache: true - cache-dependency-glob: "uv.lock" - - - name: Install dependencies - run: uv sync - - - name: Run prek - uses: j178/prek-action@v2 - env: - # The Rust workflow runs rustfmt and clippy with its own toolchain. - SKIP: rustfmt,clippy diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 21ff5741..2bd3ffb4 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -11,36 +11,8 @@ permissions: contents: read jobs: - # A skipped job counts as passed for a required check, so on a pull request - # the jobs below skip themselves when nothing they test changed, instead of - # the workflow not running at all. Pushes and releases run everything. - changes: - name: Rust changes - if: github.event_name == 'pull_request' - runs-on: ubuntu-26.04 - timeout-minutes: 5 - permissions: - pull-requests: read - outputs: - rust: ${{ steps.filter.outputs.rust }} - steps: - - uses: actions/checkout@v7 - - - uses: dorny/paths-filter@v4 - id: filter - with: - filters: | - rust: - - "rust/**" - - "protocol/**" - - "conformance/**" - - "python/tests/cluster/**" - - ".github/workflows/rust.yml" - lint: name: Rust lints - needs: changes - if: ${{ !cancelled() && (github.event_name != 'pull_request' || needs.changes.outputs.rust == 'true') }} runs-on: ubuntu-26.04 timeout-minutes: 15 defaults: @@ -70,8 +42,6 @@ jobs: test: name: Rust, ${{ matrix.backend.name }} - needs: changes - if: ${{ !cancelled() && (github.event_name != 'pull_request' || needs.changes.outputs.rust == 'true') }} runs-on: ubuntu-26.04 timeout-minutes: 15 strategy: @@ -107,8 +77,6 @@ jobs: coverage: name: Rust coverage - needs: changes - if: ${{ !cancelled() && (github.event_name != 'pull_request' || needs.changes.outputs.rust == 'true') }} runs-on: ubuntu-26.04 timeout-minutes: 20 defaults: diff --git a/README.md b/README.md index 233f997e..d63ecab7 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ on the scheduling of future work as seamlessly and efficiently as immediate work [![PyPI - Version](https://img.shields.io/pypi/v/pydocket)](https://pypi.org/project/pydocket/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pydocket)](https://pypi.org/project/pydocket/) -[![GitHub main checks](https://img.shields.io/github/check-runs/chrisguidry/docket/main)](https://github.com/chrisguidry/docket/actions/workflows/ci.yml) +[![GitHub main checks](https://img.shields.io/github/check-runs/chrisguidry/docket/main)](https://github.com/chrisguidry/docket/actions) [![Codecov](https://img.shields.io/codecov/c/github/chrisguidry/docket)](https://app.codecov.io/gh/chrisguidry/docket) [![PyPI - License](https://img.shields.io/pypi/l/pydocket)](https://github.com/chrisguidry/docket/blob/main/LICENSE) [![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://docket.lol/) diff --git a/docs/index.md b/docs/index.md index 6e464ef1..b1d6cd78 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,7 +5,7 @@ on the scheduling of future work as seamlessly and efficiently as immediate work [![PyPI - Version](https://img.shields.io/pypi/v/pydocket)](https://pypi.org/project/pydocket/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pydocket)](https://pypi.org/project/pydocket/) -[![GitHub main checks](https://img.shields.io/github/check-runs/chrisguidry/docket/main)](https://github.com/chrisguidry/docket/actions/workflows/ci.yml) +[![GitHub main checks](https://img.shields.io/github/check-runs/chrisguidry/docket/main)](https://github.com/chrisguidry/docket/actions) [![Codecov](https://img.shields.io/codecov/c/github/chrisguidry/docket)](https://app.codecov.io/gh/chrisguidry/docket) [![PyPI - License](https://img.shields.io/pypi/l/pydocket)](https://github.com/chrisguidry/docket/blob/main/LICENSE) diff --git a/python/README.md b/python/README.md index 233f997e..d63ecab7 100644 --- a/python/README.md +++ b/python/README.md @@ -3,7 +3,7 @@ on the scheduling of future work as seamlessly and efficiently as immediate work [![PyPI - Version](https://img.shields.io/pypi/v/pydocket)](https://pypi.org/project/pydocket/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pydocket)](https://pypi.org/project/pydocket/) -[![GitHub main checks](https://img.shields.io/github/check-runs/chrisguidry/docket/main)](https://github.com/chrisguidry/docket/actions/workflows/ci.yml) +[![GitHub main checks](https://img.shields.io/github/check-runs/chrisguidry/docket/main)](https://github.com/chrisguidry/docket/actions) [![Codecov](https://img.shields.io/codecov/c/github/chrisguidry/docket)](https://app.codecov.io/gh/chrisguidry/docket) [![PyPI - License](https://img.shields.io/pypi/l/pydocket)](https://github.com/chrisguidry/docket/blob/main/LICENSE) [![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://docket.lol/)