-
Notifications
You must be signed in to change notification settings - Fork 3
93 lines (80 loc) · 2.44 KB
/
ci.yml
File metadata and controls
93 lines (80 loc) · 2.44 KB
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
93
name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
ruff-format-check:
name: Ruff Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install ruff
run: pip install ruff
- name: Format check with ruff
run: |
ruff check jigsawstack/ --config .github/ruff.toml
ruff format jigsawstack/ --config .github/ruff.toml --check
test:
name: Test - ${{ matrix.test-file }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test-file:
- test_audio.py
- test_classification.py
- test_embedding.py
- test_file_store.py
- test_image_generation.py
- test_object_detection.py
- test_prediction.py
- test_sentiment.py
- test_sql.py
- test_summary.py
- test_translate.py
- test_validate.py
- test_web.py
- test_ai_scrape.py
- test_vocr.py
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-asyncio pytest-cov python-dotenv
pip install -e .
- name: Run test ${{ matrix.test-file }}
env:
JIGSAWSTACK_API_KEY: ${{ secrets.JIGSAWSTACK_API_KEY }}
run: |
pytest tests/${{ matrix.test-file }} -v
all-checks-passed:
name: All Checks Passed
needs: [ruff-format-check, test]
runs-on: ubuntu-latest
if: always()
steps:
- name: Verify all checks passed
run: |
echo "Ruff Format Check: ${{ needs.ruff-format-check.result }}"
echo "Tests: ${{ needs.test.result }}"
if [[ "${{ needs.ruff-format-check.result }}" != "success" ]]; then
echo "❌ Ruff format check failed"
exit 1
fi
if [[ "${{ needs.test.result }}" != "success" ]]; then
echo "❌ Tests failed"
exit 1
fi
echo "✅ All checks passed successfully!"