Skip to content

fix: better testing for config #309

fix: better testing for config

fix: better testing for config #309

Workflow file for this run

name: Test Python Code
on:
pull_request:
paths:
- '**/*.py'
jobs:
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
code-formatting-syntax-and-docstrings:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check code formatting using ruff
uses: chartboost/ruff-action@v1
with:
version: 0.3.1
args: format --check
- name: Check import order
uses: chartboost/ruff-action@v1
with:
version: 0.3.1
args: check --select I
- name: Check docstrings using interrogate
run: |
pip install interrogate
if [ $(interrogate -c pyproject.toml -v . -f 100 | grep "FAILED" | wc -l) = 1 ]; then
echo "necessary docstrings missing:"
interrogate -vv . -f 100
exit 1
fi
functionality-tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
needs: [code-formatting-syntax-and-docstrings]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
id: cached_python_setup
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: pyproject.toml
- run: echo '${{ steps.cached_python_setup.outputs.cache-hit }}'
- run: 'mkdir ~/.deeporigin/'
shell: bash
- name: run tests
run: |
pip install --upgrade pip
pip install --upgrade setuptools
pip install -e .[test]
make test-github