Skip to content

Commit 733b669

Browse files
authored
Merge pull request #49 from ScrapeGraphAI/fix/ci-cd
added test case and ci for test case
2 parents 2dd2ea0 + 2502ffb commit 733b669

File tree

14 files changed

+2810
-0
lines changed

14 files changed

+2810
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(apply,CacheStats{hitCount=1800, missCount=746, loadSuccessCount=738, loadExceptionCount=0, totalLoadTime=1354724079, evictionCount=0})
2+
(tree,CacheStats{hitCount=1557, missCount=924, loadSuccessCount=880, loadExceptionCount=0, totalLoadTime=3455619793, evictionCount=0})
3+
(commit,CacheStats{hitCount=586, missCount=498, loadSuccessCount=498, loadExceptionCount=0, totalLoadTime=334389419, evictionCount=0})
4+
(tag,CacheStats{hitCount=0, missCount=0, loadSuccessCount=0, loadExceptionCount=0, totalLoadTime=0, evictionCount=0})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7224a5d82990e7aefe4217a078eb982f6c7edd49 3b074a4d6b12df485cafbc013ca4371e7c859ceb .env

..bfg-report/2025-06-16/14-24-08/object-id-map.old-new.txt

Lines changed: 504 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/test.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Test Python SDK
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Cache pip dependencies
25+
uses: actions/cache@v3
26+
with:
27+
path: ~/.cache/pip
28+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
29+
restore-keys: |
30+
${{ runner.os }}-pip-${{ matrix.python-version }}-
31+
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install pytest pytest-asyncio responses
36+
cd scrapegraph-py
37+
pip install -e .
38+
39+
- name: Run tests with coverage
40+
run: |
41+
cd scrapegraph-py
42+
python -m pytest tests/ -v --cov=scrapegraph_py --cov-report=xml --cov-report=term-missing
43+
44+
- name: Run real API tests (if API key available)
45+
run: |
46+
cd scrapegraph-py
47+
if [ -n "$SGAI_API_KEY" ]; then
48+
python -m pytest tests/test_real_apis.py -v --tb=short
49+
else
50+
echo "SGAI_API_KEY not set, skipping real API tests"
51+
fi
52+
env:
53+
SGAI_API_KEY: ${{ secrets.SGAI_API_KEY }}
54+
55+
- name: Upload coverage to Codecov
56+
uses: codecov/codecov-action@v3
57+
with:
58+
file: ./scrapegraph-py/coverage.xml
59+
flags: unittests
60+
name: codecov-umbrella
61+
fail_ci_if_error: false
62+
63+
lint:
64+
runs-on: ubuntu-latest
65+
66+
steps:
67+
- uses: actions/checkout@v4
68+
69+
- name: Set up Python
70+
uses: actions/setup-python@v4
71+
with:
72+
python-version: "3.11"
73+
74+
- name: Install dependencies
75+
run: |
76+
python -m pip install --upgrade pip
77+
pip install flake8 black isort mypy
78+
cd scrapegraph-py
79+
pip install -e .
80+
81+
- name: Run linting
82+
run: |
83+
cd scrapegraph-py
84+
flake8 scrapegraph_py/ tests/ --max-line-length=88 --extend-ignore=E203,W503
85+
black --check scrapegraph_py/ tests/
86+
isort --check-only scrapegraph_py/ tests/
87+
mypy scrapegraph_py/ --ignore-missing-imports
88+
89+
security:
90+
runs-on: ubuntu-latest
91+
92+
steps:
93+
- uses: actions/checkout@v4
94+
95+
- name: Set up Python
96+
uses: actions/setup-python@v4
97+
with:
98+
python-version: "3.11"
99+
100+
- name: Install dependencies
101+
run: |
102+
python -m pip install --upgrade pip
103+
pip install bandit safety
104+
cd scrapegraph-py
105+
pip install -e .
106+
107+
- name: Run security checks
108+
run: |
109+
cd scrapegraph-py
110+
bandit -r scrapegraph_py/ -f json -o bandit-report.json || true
111+
safety check --json --output safety-report.json || true

api-keys-to-remove.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sgai-3672f339-d597-45f3-a6f3-d7041fec607b

bfg-1.14.0.jar

13.8 MB
Binary file not shown.

0 commit comments

Comments
 (0)