Skip to content

release 0.11 (soft 1.0) #861

release 0.11 (soft 1.0)

release 0.11 (soft 1.0) #861

Workflow file for this run

name: Checks
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
RUST_BACKTRACE: 1
# We rely on setup-python action to install Python,
# because it does better caching and works with 32-bit Python on Windows.
UV_PYTHON_DOWNLOADS: never
UV_NO_MANAGED_PYTHON: "true"
jobs:
test-rust:
name: Test Rust (internal tests)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: "1.93"
# even though we only test rust, we need CPython to link against
- uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Build and test
run: |
cargo test
test-rust-ext:
name: Test ubuntu, ${{ matrix.python-version }} Rust extension
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [
# NOTE: 3.10, 3.14t are absent since we test them in the OS job matrix
"3.11",
"3.12",
"3.13",
"3.14",
"3.15",
"3.15t"
]
steps:
- uses: actions/checkout@v7
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: "1.93"
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
# Testing without integrations (e.g. pydantic, time_machine) to ensure there's no accidental dependency on them
- name: Test (debug, no dependency integrations)
shell: bash
run: |
uv sync --locked --group test
uv run pytest tests/ -s -v
# Testing with integrations to ensure they work
- name: Test (debug, all dependency integrations)
if: ${{ matrix.python-version != '3.15' && matrix.python-version != '3.15t' }}
shell: bash
run: |
uv sync --locked --group test --group integrations
uv run pytest tests/ -s -v
# Release mode sometimes surfaces issues not seen in debug
- name: Test (release mode)
shell: bash
run: |
uv sync --locked --reinstall-package whenever --no-editable --group test
uv run pytest tests/ -s -v
- run: |
sudo apt-get install -y tzdata # for the zdump command
uv run python scripts/smoketest_*.py
test-os:
name: Test ${{ matrix.os }}, ${{matrix.python-version}} ${{ matrix.no_build_ext && 'pure Python' || 'Rust extension' }} ${{ matrix.architecture }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
no_build_ext: ["", "1"]
architecture: [null]
# To keep the matrix size reasonable, we only test oldest and newest Python versions on each OS.
python-version: ["3.10", "3.14t"]
include:
# For windows, we also test 32-bit Python
- os: windows
architecture: x86
no_build_ext: ""
steps:
- uses: actions/checkout@v7
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: "1.93"
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
- name: Add win32 target
if: ${{ matrix.os == 'windows' && matrix.architecture == 'x86' }}
run: rustup target add i686-pc-windows-msvc
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Sync Python environment
run: uv sync --locked --group test
env:
WHENEVER_NO_BUILD_RUST_EXT: ${{ matrix.no_build_ext }}
- name: Install and test
shell: bash
run: |
uv run pytest tests/ -s -v
# NOTE: yes, we test twice: once with optional deps, once without
uv sync --locked --group test --group integrations
uv run pytest tests/ -s -v
env:
WHENEVER_NO_BUILD_RUST_EXT: ${{ matrix.no_build_ext }}
test-pure-python:
name: Test ubuntu, ${{ matrix.python-version }} pure Python
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [
# NOTE: 3.10, 3.14t are absent since we test them in the OS job matrix
"3.11",
"3.12",
"3.13",
"3.14",
"3.15",
"3.15t",
"pypy3.11"
]
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Sync Python environment
run: uv sync --locked --group test
env:
WHENEVER_NO_BUILD_RUST_EXT: "1"
# NOTE: we end up running pytest twice in the following sections.
# This is because we want to test the code with and without optional dependencies.
- run: uv run pytest tests/
- if: ${{ !contains(fromJSON('["pypy3.11", "3.15", "3.15t"]'), matrix.python-version) }}
run: uv sync --locked --group test --group integrations
# NOTE: we only care about coverage once. We arbitrarily choose one of the Python versions to run it on
- if: ${{ matrix.python-version == '3.14' }}
run: |
uv run pytest tests/ --cov=whenever --cov-report term-missing
- if: ${{ !contains(fromJSON('["pypy3.11", "3.15", "3.15t", "3.14"]'), matrix.python-version) }}
run: |
uv run pytest tests/
- run: |
sudo apt-get install -y tzdata # for the zdump command
uv run python scripts/smoketest_*.py
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
- uses: actions/setup-python@v7
with:
python-version: '3.14'
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: "1.93"
components: "clippy, rustfmt"
- run: uv sync --locked --group dev-extra
env:
WHENEVER_NO_BUILD_RUST_EXT: "1"
- run: make ci-lint
env:
WHENEVER_NO_BUILD_RUST_EXT: "1"
typecheck:
name: Typecheck Python code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
- uses: actions/setup-python@v7
with:
python-version: '3.14'
- run: uv sync --locked --all-groups --no-install-project
env:
WHENEVER_NO_BUILD_RUST_EXT: "1"
- run: make typecheck
env:
WHENEVER_NO_BUILD_RUST_EXT: "1"
# https://github.com/marketplace/actions/alls-green#why
all-green:
name: Are all checks green?
if: always()
needs:
- test-rust-ext
- test-rust
- test-os
- test-pure-python
- lint
- typecheck
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}