Set up a full local test infrastructure for testing the CLI #36
Workflow file for this run
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: 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: | | |
cd ./client/python/cryoet_data_portal/ | |
make test-infra | |
make coverage | |
- name: Upload Coverage | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage | |
path: ./client/python/cryoet_data_portal/.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 |