Skip to content

[pre-commit.ci] pre-commit autoupdate #360

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #360

Workflow file for this run

name: Tests
# Test on all pushes, except when the push is literally just a tag (because we
# tag automatically via CI, and therefore there's no extra code in that push).
# Also, only test on pull requests into master/dev.
on:
push:
tags-ignore:
- 'v*'
pull_request:
branches:
- 'main'
jobs:
cpu_tests:
env:
ENV_NAME: tests
PYTHON: ${{ matrix.python-version }}
OS: ${{ matrix.os }}
LOG_LEVEL: ${{ (matrix.os == 'macos-latest' && 'WARNING') || 'INFO' }} # Suppress logging on macOS
name: Testing
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13]
python-version: [3.9, "3.10", "3.11"]
steps:
- uses: actions/checkout@main
with:
fetch-depth: 1
- uses: mpi4py/setup-mpi@v1
- uses: FedericoCarboni/setup-ffmpeg@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: |
pip install .[test]
- name: Run Tests
run: |
python -m pytest --ignore tests/test_plot.py --cov=matvis --cov-config=.coveragerc --cov-report xml:./coverage.xml --durations=25 --log-cli-level=${{ env.LOG_LEVEL}}
- name: Run Plotting Tests
if: matrix.python-version != '3.9' || matrix.os == 'macos-latest'
run: |
python -m pytest tests/test_plot.py --cov=matvis --cov-config=.coveragerc --cov-append --cov-report xml:./coverage.xml --durations=25 --log-cli-level=INFO
- name: Upload coverage report
uses: codecov/codecov-action@v3.1.3
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
gpu_tests:
env:
ENV_NAME: tests
PYTHON: "3.10"
OS: Ubuntu
name: Self-Hosted Tests (GPU)
runs-on: [self-hosted, gpu]
steps:
- name: Add Home to PATH
run: |
echo "/home/locoadmin/bin" >> $GITHUB_PATH
echo "/usr/local/cuda/bin" >> $GITHUB_PATH
- uses: actions/setup-node@v3.8.2
with:
node-version: 16
- uses: actions/checkout@v3.6.0
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON }}
- name: Install
run: |
echo $(which pip)
pip install .[test,gpu]
- name: Run Tests
run: |
python -m pytest -k "gpu" --cov=matvis --cov-config=.coveragerc --cov-report xml:./coverage.xml --durations=25 --log-cli-level=INFO
- name: Upload coverage report
uses: codecov/codecov-action@v3.1.3
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true