-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (72 loc) · 2.52 KB
/
build.yml
File metadata and controls
80 lines (72 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Build
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
workflow_dispatch:
env:
LATEST_PY_VERSION: '3.14'
jobs:
# Run unit tests for each supported python version
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
fail-fast: false
steps:
# Install dependencies, with caching
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: uv.lock
# HDF5 headers are required to compile pytables (no wheel yet released for python 3.14+)
- name: Install system dependencies
if: ${{ matrix.python-version == '3.14' || matrix.python-version == '3.15' }}
run: sudo apt-get update && sudo apt-get install -y libhdf5-dev
- name: Install dependencies
run: |
uv python install ${{ matrix.python-version }}
# For pytables on python 3.14+, use unreleased fixes from repo required for compilation
if [ ${{ matrix.python-version }} = '3.14' ] || [ ${{ matrix.python-version }} = '3.15' ]; then
uv sync --all-extras --no-extra hdf --frozen
uv pip install "tables @ git+https://github.com/PyTables/PyTables.git@5582fe2d"
else
uv sync --all-extras --frozen
fi
# Run tests with coverage report
- name: Run tests
run: uv run nox -e cov -- xml
# Latest python version: send coverage report to codecov
- name: "Upload coverage report to Codecov"
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: ${{ github.repository }}
fail_ci_if_error: true
# Test with no optional dependencies
test-minimal:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
- name: Install minimal dependencies
run: |
uv python install ${{ env.LATEST_PY_VERSION }}
uv sync --frozen
- name: Run smoke test
run: uv run pytest test/test_converters.py::test_to_dataset
# Run linting & other checks via pre-commit hooks
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ env.LATEST_PY_VERSION }}
- name: Run style checks & linting
uses: j178/prek-action@v1