Skip to content

pre-commit.ci: update pre-commit hooks #854

pre-commit.ci: update pre-commit hooks

pre-commit.ci: update pre-commit hooks #854

Workflow file for this run

---
name: Test
on:
push:
branches:
- main
pull_request:
types:
- opened
- ready_for_review
- reopened
- synchronize
concurrency:
cancel-in-progress: true
group: >-
${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
env:
BENCH_COV_NAME: cov-bench
CORE_COV_NAME: cov-core
jobs:
tests-bench:
if: github.event.pull_request.draft == false
name: Benchmark Tests
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
python-version: 3.14
- name: Cache nox
uses: actions/cache@v5
with:
key:
tests-bench-${{ hashFiles('pyproject.toml') }}-${{
hashFiles('noxfile.py') }}
path: .nox
- name: Install only dev dependencies
run: uv sync --only-dev
- name: Check version
run: uv run nox -s version
env:
FORCE_COLOR: 1
- name: Run benchmark tests with all backends and generate coverage report
run: uv run nox -s coverage_benchmarks --verbose
env:
ARRAY_BACKEND: all
COVERAGE_FILE: ${{ env.BENCH_COV_NAME }}
FORCE_COLOR: 1
- name: Generate XML report for benchmark tests
run: >-
uv run coverage xml --data-file ${{ env.BENCH_COV_NAME }} -o ${{
env.BENCH_COV_NAME }}.xml
- name: Upload benchmark coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
base-path: glass/
file: ${{ env.BENCH_COV_NAME }}.xml
flag-name: ${{ env.BENCH_COV_NAME }}
parallel: true
tests-core:
if: github.event.pull_request.draft == false
name: Core Tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
steps:
- name: Checkout source
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
- name: Cache nox
uses: actions/cache@v5
with:
key:
tests-core-${{ hashFiles('pyproject.toml') }}-${{
hashFiles('noxfile.py') }}-${{ matrix.python-version }}
path: .nox
- name: Install only dev dependencies
run: uv sync --only-dev
- name: Install ubuntu dependencies for fitsio
run: sudo apt-get install -y libbz2-dev
- name: Run doctests
run: uv run nox -s doctests-${{ matrix.python-version }} --verbose
env:
FORCE_COLOR: 1
- name: Run core tests with all backends and generate coverage report
run: uv run nox -s coverage-${{ matrix.python-version }} --verbose
env:
ARRAY_BACKEND: all
COVERAGE_FILE: ${{ env.CORE_COV_NAME }}-${{ matrix.python-version }}
FORCE_COLOR: 1
- name: Generate XML report for core tests
run: >-
uv run coverage xml --data-file ${{env.CORE_COV_NAME }}-${{
matrix.python-version }} -o ${{ env.CORE_COV_NAME }}-${{
matrix.python-version }}.xml
- name: Upload core coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
base-path: glass/
file: ${{ env.CORE_COV_NAME }}-${{ matrix.python-version }}.xml
flag-name: ${{ env.CORE_COV_NAME }}-${{ matrix.python-version }}
parallel: true
aggregate-tests:
needs:
- tests-bench
- tests-core
if: always()
runs-on: ubuntu-latest
steps:
- name: Coveralls finished
uses: coverallsapp/github-action@v2
with:
carryforward:
${{ env.BENCH_COV_NAME }},${{ env.CORE_COV_NAME }}-3.10,${{
env.CORE_COV_NAME }}-3.11,${{ env.CORE_COV_NAME }}-3.12,${{
env.CORE_COV_NAME }}-3.13,${{ env.CORE_COV_NAME }}-3.14
parallel-finished: true
build:
if: github.event.pull_request.draft == false
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
python-version: 3.14
- name: Install only dev dependencies
run: uv sync --only-dev
- name: Build SDist and wheel
run: uv run nox -s build
env:
FORCE_COLOR: 1