Skip to content

chore: ✅ update pre-commit hooks (#148) #451

chore: ✅ update pre-commit hooks (#148)

chore: ✅ update pre-commit hooks (#148) #451

Workflow file for this run

name: Run test suite
on:
pull_request:
push:
branches:
- main
jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest]
# NOTE: If bumping the minimum Python version here, also do it in
# ruff.toml, setup.py and other CI files as well.
# test with oldest and latest supported Python versions
python-version: ["3.10", "3.13"]
# test with oldest supported Python version only (for slow tests)
# python-version: ["3.10"]
# test with *all* supported Python versions
# python-version: ["3.10", "3.11", "3.12", "3.13"]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Set up Git repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Restore UV environment
run: cp production.uv.lock uv.lock
- name: Install dev requirements
run: |
uv sync --extra dev --frozen
- name: Run test suite
run: |
uv run --no-sync pytest \
--cov-report=term-missing:skip-covered \
--cov-report=xml:coverage.xml \
--cov=tesseract_streamlit
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: ${{ github.repository }}
files: coverage*.xml
fail_ci_if_error: true
test-macos: # note: docker not available
runs-on: macos-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Restore UV environment
run: cp production.uv.lock uv.lock
- name: Install dev requirements
run: |
uv sync --extra dev --frozen
- name: Run selected tests
run: |
uv run --no-sync pytest --noconftest tests/test_visuals.py::test_pyvista_vis
all-ok:
if: always()
needs: [tests, test-macos]
runs-on: ubuntu-latest
steps:
- name: Check for errors
run: |
if [[ "${{ needs.tests.result }}" != "success" && "${{ needs.tests.result }}" != "skipped" ]]; then
echo "Linux tests failed"
exit 1
fi
if [[ "${{ needs.test-macos.result }}" != "success" && "${{ needs.test-macos.result }}" != "skipped" ]]; then
echo "macOS tests failed"
exit 1
fi
echo "All tests passed!"