add tests to complete 100% coverage #203
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: ['**'] | |
| workflow_dispatch: | |
| concurrency: | |
| group: build-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| continue-on-error: ${{ matrix.experimental }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - python-version: '3.9' | |
| experimental: false | |
| - python-version: '3.10' | |
| experimental: false | |
| - python-version: '3.11' | |
| experimental: false | |
| - python-version: '3.12' | |
| experimental: false | |
| - python-version: '3.13' | |
| experimental: false | |
| - python-version: '3.14' | |
| experimental: true | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| cache-dependency-path: setup.py | |
| - name: Install dependencies (Python 3.8-3.10) | |
| if: contains(fromJSON('["3.8", "3.9", "3.10"]'), matrix.python-version) | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install "numpy<2" matplotlib | |
| pip install torch torchvision torchaudio | |
| pip install .[dev] | |
| - name: Install dependencies (Python 3.11+) | |
| if: ${{ !contains(fromJSON('["3.8", "3.9", "3.10"]'), matrix.python-version) }} | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install "numpy<2" | |
| pip install torch torchvision torchaudio | |
| pip install .[dev] | |
| - name: Run tests with coverage | |
| run: | | |
| coverage run -m pytest | |
| coverage xml -o coverage-${{ matrix.python-version }}.xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| files: coverage-${{ matrix.python-version }}.xml | |
| flags: py${{ matrix.python-version }} | |
| name: tests-py${{ matrix.python-version }} | |
| docs: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: pip | |
| cache-dependency-path: setup.py | |
| - name: Install docs dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install . | |
| pip install sphinx sphinx-book-theme myst-nb | |
| - name: Build docs and check links | |
| run: make -C doc html linkcheck | |
| - name: Upload docs artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: doc/_build/html | |
| deploy-docs: | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
| runs-on: ubuntu-latest | |
| needs: docs | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| uses: actions/deploy-pages@v4 |