Skip to content

INTERMAGNET Support #2872

INTERMAGNET Support

INTERMAGNET Support #2872

Workflow file for this run

name: Testing
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
setup-build:
name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
defaults:
run:
shell: bash -e {0}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up uv
uses: astral-sh/setup-uv@v5
- name: Cache MTH5 Test Fixtures
uses: actions/cache@v3
with:
path: ~/mth5_global_test_cache
key: mth5-fixtures-${{ runner.os }}-${{ hashFiles('mth5/data/make_mth5_from_asc.py', 'mth5/clients/fdsn.py', 'tests/conftest.py') }}
restore-keys: |
mth5-fixtures-${{ runner.os }}-
- name: Create Cache Directory
run: mkdir -p ~/mth5_global_test_cache
- name: Install Env
run: |
python --version
uv pip install --system \
pytest \
pytest-cov \
pytest-subtests \
"pytest-xdist[psutil]" \
pytest-benchmark \
setuptools \
"mt_metadata[obspy]" \
"git+https://github.com/kujaku11/mt-io.git@develop" \
"git+https://github.com/kujaku11/mth5_test_data.git"
- name: Install Our Package
run: |
uv pip install --system -e .
pip list
#- name: Install Jupyter and dependencies
# run: |
# source activate mth5-test
# pip install jupyter
# pip install ipykernel
# pip install ipympl
# python -m ipykernel install --user --name mth5-test
# # Install any other dependencies you need
#- name: Execute Jupyter Notebooks
# run: |
# source activate mth5-test
# jupyter nbconvert --to notebook --execute docs/examples/notebooks/make_mth5_driver_v0.2.0.ipynb
- name: Run Tests
run: |
if [ "${{ matrix.python-version }}" = "3.13" ]; then
pytest -vv --cov=./ --cov-report=xml --cov=mth5 -n auto tests -k "not slow"
else
pytest -vv -n auto tests -k "not slow"
fi
- name: Upload coverage to Codecov
if: matrix.python-version == '3.13'
uses: codecov/codecov-action@v3
with:
flags: tests
fail_ci_if_error: false
verbose: true