60 lines
1.5 KiB
YAML
60 lines
1.5 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main, dev]
|
|
pull_request:
|
|
branches: [main, dev]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
pip install -r tests/requirements-test.txt
|
|
|
|
- name: Run unit tests
|
|
run: |
|
|
pytest tests/ -m "unit" -v --tb=short --ignore=tests/browser_tests
|
|
|
|
- name: Run optional dependency tests
|
|
continue-on-error: true
|
|
run: |
|
|
pytest tests/ -m "optional" -v --tb=short --ignore=tests/browser_tests
|
|
|
|
- name: Upload test outputs
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: test-outputs-${{ matrix.os }}
|
|
path: tests/outputs/
|
|
retention-days: 7
|
|
|
|
- name: Generate coverage report
|
|
if: matrix.os == 'ubuntu-latest'
|
|
run: |
|
|
pip install pytest-cov
|
|
pytest tests/ -m "unit" --cov=nodes --cov-report=xml --cov-report=html --ignore=tests/browser_tests
|
|
|
|
- name: Upload coverage
|
|
if: matrix.os == 'ubuntu-latest'
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
file: ./coverage.xml
|
|
fail_ci_if_error: false
|