Skip to content

linting + CI

linting + CI #10

Workflow file for this run

name: Python Client Tests
on:
push:
branches:
- main
paths:
- 'client/python/**'
- '.github/workflows/**'
pull_request:
branches:
- '**'
paths:
- 'client/python/**'
- '.github/workflows/**'
jobs:
test-client-python:
name: Test Python Client
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -U pip setuptools wheel
pip install -r ./client/python/cryoet_data_portal/scripts/requirements-dev.txt
pip install -e ./client/python/cryoet_data_portal/
- name: Test with pytest (API)
run: |
PYTHONPATH=. coverage run --parallel-mode -m pytest -v -rP --durations=20 ./client/python/cryoet_data_portal/tests/
- name: Upload Coverage
uses: actions/upload-artifact@v3
with:
name: coverage
path: ./.coverage*
retention-days: 3
submit-codecoverage:
needs:
- test-client-python
runs-on: ubuntu-20.04
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download Coverage
uses: actions/download-artifact@v3
with:
name: coverage
path: .
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Requirements
run: |
pip install coverage
- name: Generate Coverage Report
run: |
coverage combine
coverage xml
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON
files: ./coverage.xml
flags: unittests
name: codecov-umbrella