[pre-commit.ci] pre-commit autoupdate (#1236) #2531
This file contains 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: Run code coverage | |
on: | |
push: | |
branches: | |
- dev | |
tags-ignore: # exclude tags created by "ci_addons publish_github_release" | |
- 'latest' | |
- 'latest-tmp' | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
run-coverage: | |
name: ${{ matrix.os }}, opt reqs ${{ matrix.opt_req }} | |
runs-on: ${{ matrix.os }} | |
# TODO handle forks | |
# run pipeline on either a push event or a PR event on a fork | |
# if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
defaults: | |
run: | |
shell: bash | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.opt_req }} | |
cancel-in-progress: true | |
strategy: | |
matrix: | |
include: | |
- { os: ubuntu-latest , opt_req: true } | |
- { os: ubuntu-latest , opt_req: false } | |
- { os: windows-latest, opt_req: false } | |
- { os: macos-latest , opt_req: false } | |
env: # used by codecov-action | |
OS: ${{ matrix.os }} | |
PYTHON: '3.12' # TODO: Update to 3.13 when linkml and its deps support 3.13 | |
steps: | |
- name: Checkout repo with submodules | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
fetch-depth: 0 # tags are required to determine the version | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON }} | |
- name: Upgrade pip | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install package | |
if: ${{ ! matrix.opt_req }} | |
run: | | |
python -m pip install ".[test]" | |
- name: Install package with optional dependencies | |
if: ${{ matrix.opt_req }} | |
run: | | |
python -m pip install ".[test,tqdm,zarr,termset]" | |
- name: Run tests and generate coverage report | |
run: | | |
# coverage is configured in pyproject.toml | |
# codecov uploader requires xml format | |
python -m pip list | |
pytest --cov --cov-report=xml --cov-report=term | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
fail_ci_if_error: true | |
files: ./coverage.xml | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
run-ros3-coverage: | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} # necessary for conda | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.name }} | |
cancel-in-progress: true | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { name: linux-python3.13-ros3 , python-ver: "3.13", os: ubuntu-latest } | |
steps: | |
- name: Checkout repo with submodules | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
fetch-depth: 0 # tags are required to determine the version | |
- name: Set up Conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
activate-environment: ros3 | |
environment-file: environment-ros3.yml | |
python-version: ${{ matrix.python-ver }} | |
channels: conda-forge | |
auto-activate-base: false | |
- name: Install run dependencies | |
run: | | |
pip install . | |
pip list | |
- name: Conda reporting | |
run: | | |
conda info | |
conda config --show-sources | |
conda list --show-channel-urls | |
- name: Run ros3 tests # TODO include gallery tests after they are written | |
run: | | |
pytest --cov --cov-report=xml --cov-report=term tests/unit/test_io_hdf5_streaming.py | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
fail_ci_if_error: true | |
files: ./coverage.xml | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |