Skip to content

Update all

Update all #1032

Workflow file for this run

name: test
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
jobs:
run:
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.12", "3.13", "3.14"]
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install Hatch
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc # install
- name: Run static analysis
run: hatch fmt --check
- name: Check types
run: hatch run types:check
- name: Run tests
run: hatch test --python ${{ matrix.python-version }} --cover-quiet --randomize
- name: Create coverage report
run: hatch run hatch-test.py${{ matrix.python-version }}:coverage xml
- name: Upload coverage data
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: coverage-${{ matrix.os }}-${{ matrix.python-version }}
path: coverage.xml
coverage:
name: Upload coverage
needs:
- run
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Download coverage data
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: coverage-*
path: coverage_data
- name: Upload coverage to Codecov
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
with:
directory: coverage_data
use_oidc: true
- name: Get Datadog credentials
id: dd-sts
continue-on-error: true
uses: DataDog/dd-sts-action@1f350ca511be980515cf08b0bd64182b9c6e5d32 # v1.0.3
with:
policy: datadog-agent-dev
- name: Upload coverage to Datadog
if: steps.dd-sts.outputs.api_key != ''
continue-on-error: true
run: npx @datadog/datadog-ci@5.12.1 coverage upload coverage_data
env:
DD_API_KEY: ${{ steps.dd-sts.outputs.api_key }}
check:
if: always()
needs:
- run
- coverage
runs-on: ubuntu-latest
steps:
- name: Verify dependent success
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
jobs: ${{ toJSON(needs) }}