Flesh out readme (#80) #313
This file contains hidden or 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
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
env: | |
PYTEST_ADDOPTS: "-v --color=yes" | |
FORCE_COLOR: "1" | |
jobs: | |
test: | |
name: Tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- python-version: "3.13" | |
test-extra: test-min | |
- python-version: "3.11" | |
- python-version: "3.13" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
filter: blob:none | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: astral-sh/setup-uv@v5 | |
with: | |
enable-cache: true | |
cache-dependency-glob: pyproject.toml | |
- run: uv pip install --system -e .[${{ matrix.test-extra || 'test' }}] | |
- run: | | |
coverage run -m pytest -m "not benchmark" | |
coverage report | |
# https://github.com/codecov/codecov-cli/issues/648 | |
coverage xml | |
rm test-data/.coverage | |
- uses: codecov/codecov-action@v5 | |
with: | |
name: Min Tests | |
fail_ci_if_error: true | |
files: test-data/coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
bench: | |
name: CPU Benchmarks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' | |
- uses: astral-sh/setup-uv@v5 | |
with: | |
enable-cache: true | |
cache-dependency-glob: pyproject.toml | |
- run: uv pip install --system -e .[test,full] | |
- uses: CodSpeedHQ/action@v3 | |
with: | |
run: pytest -m benchmark --codspeed | |
token: ${{ secrets.CODSPEED_TOKEN }} | |
import: | |
name: Import Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
filter: blob:none | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' | |
- uses: astral-sh/setup-uv@v5 | |
with: | |
cache-dependency-glob: pyproject.toml | |
- run: uv pip install --system -e . | |
- run: python -c 'import fast_array_utils as fau; print(fau.__all__)' | |
- run: uv pip install --system -e .[testing] | |
- run: python -c 'import testing.fast_array_utils as tfau; print(tfau.ArrayType("numpy", "ndarray"))' | |
check: | |
name: Static Checks | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11", "3.13"] | |
env: | |
SKIP: no-commit-to-branch # this CI runs on the main branch | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
filter: blob:none | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: pre-commit/[email protected] |