Skip to content

Test fixes

Test fixes #477

Workflow file for this run

name: Test Python Code
on:
pull_request:
paths:
- '**/*.py'
jobs:
check-for-debug-code:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Search for "icecream" in .py files
run: |
if grep -ri "icecream" --include="*.py" .; then
echo "❌🍦: Found 'icecream' in one or more .py files, suggesting that you forgot to remove debug code"
exit 1
fi
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.10", "3.11", "3.12", "3.13"]
needs: [code-formatting-syntax-and-docstrings, check-for-debug-code]
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
- name: "run tests without ~/.deeporigin/"
run: |
pip install --upgrade pip
pip install --upgrade setuptools
pip install -e .[test]
make test-github