Skip to content

Add curie query support (mychem version) #98

Add curie query support (mychem version)

Add curie query support (mychem version) #98

Workflow file for this run

name: Tests
on:
push: {}
workflow_dispatch: {}
pull_request:
branches:
- master
jobs:
build_package_and_run_tests:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10", "3.11" ]
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: pip install --upgrade pip
- name: Install Package Dependencies
run: pip install .
if: (matrix.python-version != 2.7) && (matrix.python-version != 3.6)
- name: Install Dependencies mannually for Py2.7 or Py3.6
run: pip install requests
if: (matrix.python-version == 2.7) || (matrix.python-version == 3.6)
- name: Install coverage
run: pip install coverage
if: matrix.python-version == 3.10
- name: Run Tests with coverage
# only need to run coverage once on selected Python version
run: coverage run --source . -m unittest tests/*.py
if: matrix.python-version == 3.10
- name: Coverage report
run: |
coverage report -m
# generate coverage.xml output
coverage xml
# upload coverage to codacy
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.xml
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
if: matrix.python-version == 3.10
- name: Run Tests
run: python -m unittest tests/*.py
if: (matrix.python-version != 2.7) && (matrix.python-version != 3.6) && (matrix.python-version != 3.10)
- name: Run Tests
# since we cannot install packages in Py<3.7, we will use biothings_client
# directly from the current working directory
# `python -m unittest tests/*.py` does not work in Py2.7, so we run tests differently below
run: PYTHONPATH=. python tests/test.py
if: (matrix.python-version == 2.7) || (matrix.python-version == 3.6)