Fix return type annotation #1391
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: CI | |
on: [push, pull_request, workflow_dispatch] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
FORCE_COLOR: "1" | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build-packages: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone the repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build packages | |
uses: ./.github/actions/build-packages | |
test: | |
needs: build-packages | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
python: | |
- version: "3.11" | |
- version: "3.12" | |
- version: "3.13" | |
- version: "3.13" | |
install-version: 3.13t | |
include: | |
- os: ubuntu-latest | |
python: | |
version: "3.10" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Clone the repo | |
uses: actions/checkout@v4 | |
- name: Download pre-built packages | |
uses: actions/download-artifact@v4 | |
with: | |
name: packages | |
path: ./dist | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install Python ${{ matrix.python.install-version || matrix.python.version }} | |
run: uv python install ${{ matrix.python.install-version || matrix.python.version }} | |
- name: Install nox | |
run: uv tool install nox | |
- name: Run tests (latest) | |
run: >- | |
nox | |
--error-on-missing-interpreters | |
--force-python ${{ matrix.python.version }} | |
-s 'test-${{ matrix.python.version }}(latest)' | |
- name: Upload coverage data | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-data-${{ matrix.os }}-${{ matrix.python.install-version || matrix.python.version }} | |
path: .coverage.* | |
if-no-files-found: ignore | |
include-hidden-files: true | |
- name: Run tests (minimum versions) | |
run: >- | |
nox | |
--error-on-missing-interpreters | |
--force-python ${{ matrix.python.version }} | |
-s 'test-${{ matrix.python.version }}(minimum-versions)' | |
type-check: | |
needs: build-packages | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
python: | |
- version: "3.11" | |
- version: "3.12" | |
- version: "3.13" | |
include: | |
- os: ubuntu-latest | |
python: | |
- version: "3.10" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Clone the repo | |
uses: actions/checkout@v4 | |
- name: Download pre-built packages | |
uses: actions/download-artifact@v4 | |
with: | |
name: packages | |
path: ./dist | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install Python ${{ matrix.python.install-version }} | |
run: uv python install ${{ matrix.python.install-version }} | |
- name: Install nox | |
run: uv tool install nox | |
- name: Install Node for Pyright | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Type check | |
run: >- | |
nox | |
--error-on-missing-interpreters | |
--force-python ${{ matrix.python.version }} | |
-s type_check | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone the repo | |
uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install nox | |
run: uv tool install nox | |
- name: Install Node for Prettier | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Lint | |
run: nox -s lint | |
# Nicked from attrs. | |
coverage: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Clone the repo | |
uses: actions/checkout@v4 | |
- name: Download coverage data | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: coverage-data-* | |
merge-multiple: true | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install nox | |
run: uv tool install nox | |
- name: Produce coverage report | |
run: | | |
nox -s report_coverage | |
- name: Upload HTML report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: html-report | |
path: htmlcov |