5050
5151 - name : Check formatting for ${{ matrix.file }}
5252 run : |
53- ruff check jigsawstack/${{ matrix.file }} --select I,F,E,W
54- ruff format --check jigsawstack/${{ matrix.file }}
53+ ruff check jigsawstack/${{ matrix.file }} --config .github/ruff.toml
54+ ruff format --check jigsawstack/${{ matrix.file }} --config .github/ruff.toml
5555
5656 test :
5757 name : Test - ${{ matrix.test-file }}
7474 - test_validate.py
7575 - test_vision.py
7676 - test_web.py
77- outputs :
78- test-result : ${{ steps.test-run.outcome }}
7977 steps :
8078 - uses : actions/checkout@v4
8179
@@ -92,63 +90,30 @@ jobs:
9290 pip install -e .
9391
9492 - name : Run test ${{ matrix.test-file }}
95- id : test-run
9693 env :
9794 JIGSAWSTACK_API_KEY : ${{ secrets.JIGSAWSTACK_API_KEY }}
9895 run : |
99- pytest tests/${{ matrix.test-file }} -v --json-report --json-report-file=report.json
100-
101- - name : Count passed tests
102- id : count-tests
103- if : always()
104- run : |
105- if [ -f report.json ]; then
106- PASSED=$(python -c "import json; data=json.load(open('report.json')); print(data.get('summary', {}).get('passed', 0))")
107- echo "passed-count=$PASSED" >> $GITHUB_OUTPUT
108- else
109- echo "passed-count=0" >> $GITHUB_OUTPUT
110- fi
111-
112- - name : Upload test results
113- if : always()
114- uses : actions/upload-artifact@v4
115- with :
116- name : test-results-${{ matrix.test-file }}
117- path : report.json
96+ pytest tests/${{ matrix.test-file }} -v
11897
11998 all-checks-passed :
12099 name : All Checks Passed
121100 needs : [ruff-format-check, test]
122101 runs-on : ubuntu-latest
123102 if : always()
124103 steps :
125- - name : Download all test results
126- uses : actions/download-artifact@v4
127- with :
128- path : test-results
129-
130- - name : Count total passed tests
104+ - name : Verify all checks passed
131105 run : |
132- TOTAL_PASSED=0
133- for file in test-results/*/report.json; do
134- if [ -f "$file" ]; then
135- PASSED=$(python -c "import json; data=json.load(open('$file')); print(data.get('summary', {}).get('passed', 0))")
136- TOTAL_PASSED=$((TOTAL_PASSED + PASSED))
137- fi
138- done
139-
140- echo "Total passed tests: $TOTAL_PASSED"
106+ echo "Ruff Format Check: ${{ needs.ruff-format-check.result }}"
107+ echo "Tests: ${{ needs.test.result }}"
141108
142- if [ $TOTAL_PASSED -lt 327 ]; then
143- echo "❌ Insufficient tests passed: $TOTAL_PASSED/327 "
109+ if [[ "${{ needs.ruff-format-check.result }}" != "success" ] ]; then
110+ echo "❌ Ruff format check failed "
144111 exit 1
145- else
146- echo "✅ Required tests passed: $TOTAL_PASSED/327"
147112 fi
148-
149- - name : Check if ruff passed
150- run : |
151- if [[ "${{ needs.ruff-format-check.result }}" != "success" ]]; then
152- echo "Ruff format check failed"
113+
114+ if [[ "${{ needs.test.result }}" != "success" ]]; then
115+ echo "❌ Tests failed"
153116 exit 1
154- fi
117+ fi
118+
119+ echo "✅ All checks passed successfully!"
0 commit comments