tests #86
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: tests | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| schedule: | |
| - cron: '0 0 * * 1' # run every Monday | |
| workflow_call: | |
| workflow_dispatch: | |
| env: | |
| PYTEST_ADDOPTS: "--color=yes" | |
| jobs: | |
| tests: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-13, windows-latest] | |
| python-version: ["3.13"] | |
| include: | |
| - os: ubuntu-latest | |
| python-version: "3.9" | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - name: Initialisation | |
| uses: actions/checkout@v4 | |
| - name: Set up conda | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| auto-update-conda: true | |
| activate-environment: conda-environment | |
| environment-file: .github/environment.yml | |
| - name: Install package | |
| run: python -m pip install .[dev] | |
| - name: Unit tests | |
| run: invoke test.unittest | |
| if: matrix.os != 'ubuntu-latest' | |
| - name: Unit tests with coverage | |
| run: invoke test.coverage | |
| if: matrix.os == 'ubuntu-latest' | |
| - name: Documentation tests | |
| run: invoke test.docs | |
| - name: Jupyter notebook tests | |
| run: invoke test.ipynb | |
| - name: Upload coverage to Codecov.io | |
| uses: codecov/codecov-action@v1 | |
| if: matrix.os == 'ubuntu-latest' | |
| build: | |
| needs: tests | |
| name: Build wheel and sdist | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install pypa/build | |
| run: python -m pip install --user build | |
| - name: Build wheel and source tarball | |
| run: python -m build | |
| - name: Store the distribution packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ |