-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (73 loc) · 2.25 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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