Skip to content

Upgrade validation methods #1805

Upgrade validation methods

Upgrade validation methods #1805

Workflow file for this run

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
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:
OS: ${{ matrix.os }}
PYTHON: '3.13'
steps:
- name: Cancel non-latest runs
uses: styfle/[email protected]
with:
all_but_latest: true
access_token: ${{ github.token }}
- uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0 # tags are required for versioneer to determine the version
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt -r requirements.txt
- name: Install optional dependencies
if: ${{ matrix.opt_req }}
run: python -m pip install -r requirements-opt.txt
- name: Install package
run: |
python -m pip install .
python -m pip list
- name: Run unit tests and generate coverage report
run: |
python -m coverage run test.py --pynwb
python -m coverage xml # codecov uploader requires xml format
python -m coverage report
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
flags: unit
file: coverage.xml
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Run integration tests and generate coverage report
run: |
python -m coverage run -p test.py --integration --validation-module --backwards
# validation CLI tests generate separate .coverage files that need to be merged
python -m coverage combine
python -m coverage xml # codecov uploader requires xml format
python -m coverage report
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
flags: integration
file: coverage.xml
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}