Skip to content

New phosphoros filters #3167

New phosphoros filters

New phosphoros filters #3167

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python application
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
types: [labeled, unlabeled, opened, edited, synchronize]
jobs:
build:
runs-on: ubuntu-latest
env:
TEST_ONLY_FAST: ${{ contains( github.event.pull_request.labels.*.name, 'test-only-fast') }}
strategy:
matrix:
python-version: [3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest mypy pylint pytest-cov pytest-xdist wheel
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e .[test,ontology]
curl -o tests/oda-ontology.ttl https://raw.githubusercontent.com/oda-hub/ontology/main/ontology.ttl
- name: Lint with flake8
if: ${{ env.TEST_ONLY_FAST != 'true' }}
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics || echo "failed lint"
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics || echo "failed second lint"
- name: PyLint - more lint
if: ${{ env.TEST_ONLY_FAST != 'true' }}
run: |
pylint -E cdci_data_analysis || echo 'this is fine!'
- name: MyPy
if: ${{ env.TEST_ONLY_FAST != 'true' }}
run: |
mypy cdci_data_analysis --ignore-missing-imports || echo 'this is fine too!'
- name: Test fast subset with pytest
run: |
python -m pytest tests --cov=cdci_data_analysis -sv --full-trace --log-cli-level=DEBUG -m "not test_drupal and fast and not test_renku and not test_matrix" --durations=0
- name: Test everything with pytest
if: ${{ env.TEST_ONLY_FAST != 'true' }}
run: |
python -m pytest tests --cov=cdci_data_analysis -sv --full-trace --log-cli-level=DEBUG -m "not test_drupal and not test_renku and not test_matrix" --durations=0
# I wonder how this interacts with the Github App. But this is not only for PR. Also this does not always work
- name: Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true