8
8
types : [published]
9
9
10
10
jobs :
11
- deploy :
11
+ test :
12
+ runs-on : ubuntu-latest
13
+ strategy :
14
+ matrix :
15
+ python-version : ["3.8", "3.9", "3.10", "3.11", "3.12"]
16
+
17
+ steps :
18
+ - uses : actions/checkout@v4
19
+
20
+ - name : Set up Python ${{ matrix.python-version }}
21
+ uses : actions/setup-python@v4
22
+ with :
23
+ python-version : ${{ matrix.python-version }}
24
+
25
+ - name : Cache pip dependencies
26
+ uses : actions/cache@v3
27
+ with :
28
+ path : ~/.cache/pip
29
+ key : ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
30
+ restore-keys : |
31
+ ${{ runner.os }}-pip-${{ matrix.python-version }}-
32
+
33
+ - name : Install dependencies
34
+ run : |
35
+ python -m pip install --upgrade pip
36
+ pip install pytest pytest-asyncio responses
37
+ cd scrapegraph-py
38
+ pip install -e .
39
+
40
+ - name : Run tests with coverage
41
+ run : |
42
+ cd scrapegraph-py
43
+ python -m pytest tests/ -v --cov=scrapegraph_py --cov-report=xml --cov-report=term-missing
44
+
45
+ - name : Run real API tests (if API key available)
46
+ run : |
47
+ cd scrapegraph-py
48
+ if [ -n "$SGAI_API_KEY" ]; then
49
+ python -m pytest tests/test_real_apis.py -v --tb=short
50
+ else
51
+ echo "SGAI_API_KEY not set, skipping real API tests"
52
+ fi
53
+ env :
54
+ SGAI_API_KEY : ${{ secrets.SGAI_API_KEY }}
12
55
56
+ deploy :
57
+ needs : test
13
58
runs-on : ubuntu-latest
14
59
15
60
steps :
@@ -21,12 +66,13 @@ jobs:
21
66
- name : Install dependencies
22
67
run : |
23
68
python -m pip install --upgrade pip
24
- pip install setuptools wheel twine
69
+ pip install setuptools wheel twine build
25
70
- name : Build and publish
26
71
env :
27
72
TWINE_USERNAME : mvincig11
28
73
TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
29
74
run : |
30
75
git fetch --all --tags
31
- python setup.py sdist bdist_wheel
76
+ cd scrapegraph-py
77
+ python -m build
32
78
twine upload dist/*
0 commit comments