-
Notifications
You must be signed in to change notification settings - Fork 8
89 lines (76 loc) · 2.57 KB
/
Copy pathtests.yaml
File metadata and controls
89 lines (76 loc) · 2.57 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
81
82
83
84
85
86
87
88
89
name: Testing
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
setup-build:
name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Cache MTH5 test files
uses: actions/cache@v4
with:
path: ~/.cache/aurora
key: mth5-test-files-${{ runner.os }}-${{ hashFiles('tests/conftest.py') }}
restore-keys: |
mth5-test-files-${{ runner.os }}-
- name: Create virtual environment and install dependencies
run: |
uv venv --python ${{ matrix.python-version }}
source .venv/bin/activate
uv pip install --upgrade pip
uv pip install 'setuptools<68'
uv pip install -e ".[dev,test]"
uv pip install git+https://github.com/kujaku11/mth5_test_data.git
# Explicitly include nbconvert & ipykernel
uv pip install jupyter nbconvert nbformat ipykernel pytest pytest-cov pytest-timeout codecov
python -m ipykernel install --user --name "python3"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y pandoc
- name: Run Tests
run: |
source .venv/bin/activate
pytest -s -v --cov=./ --cov-report=xml --cov=aurora -n auto tests
- name: "Upload coverage reports to Codecov"
uses: codecov/codecov-action@v4
with:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
flags: tests
# Note: these conditions won't match python-version 3.10; adjust if desired.
- name: Build Doc
if: ${{ (github.ref == 'refs/heads/main') && (matrix.python-version == '3.8') }}
run: |
source .venv/bin/activate
cd docs
make html
cd ..
- name: GitHub Pages
if: ${{ (github.ref == 'refs/heads/main') && (matrix.python-version == '3.8') }}
uses: crazy-max/ghaction-github-pages@v2.5.0
with:
build_dir: docs/_build/html
jekyll: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}