1313 strategy :
1414 matrix :
1515 python-version : ["3.11", "3.12"]
16- outputs :
17- passed : ${{ steps.results.outputs.passed }}
18- failed : ${{ steps.results.outputs.failed }}
1916
2017 steps :
2118 - uses : actions/checkout@v4
3229
3330 - name : Run test suite
3431 run : |
35- set -o pipefail
36- python -m pytest tests/ -q --timeout=60 --ignore=tests/test_integration.py 2>&1 | tee pytest-output.txt
32+ python -m pytest tests/ -q --timeout=60 --ignore=tests/test_integration.py
3733 timeout-minutes : 10
3834
3935 - name : Run integration tests (allow failure)
@@ -42,24 +38,12 @@ jobs:
4238 python -m pytest tests/test_integration.py -q --timeout=120
4339 timeout-minutes : 5
4440
45- - name : Parse test results
46- if : always() && matrix.python-version == '3.12'
47- id : results
48- run : |
49- SUMMARY=$(grep -E '(\d+ passed|\d+ failed)' pytest-output.txt | tail -1)
50- PASSED=$(echo "$SUMMARY" | grep -oP '\d+(?= passed)' || echo "0")
51- FAILED=$(echo "$SUMMARY" | grep -oP '\d+(?= failed)' || echo "0")
52- echo "passed=${PASSED}" >> $GITHUB_OUTPUT
53- echo "failed=${FAILED}" >> $GITHUB_OUTPUT
54-
5541 typescript-tests :
5642 name : TypeScript SDK Tests (Node ${{ matrix.node-version }})
5743 runs-on : ubuntu-latest
5844 strategy :
5945 matrix :
6046 node-version : ["18", "20"]
61- outputs :
62- passed : ${{ steps.results.outputs.passed }}
6347
6448 steps :
6549 - uses : actions/checkout@v4
8670
8771 - name : Run test suite
8872 working-directory : sdks/typescript
89- run : |
90- set -o pipefail
91- npm test 2>&1 | tee test-output.txt
73+ run : npm test
9274 timeout-minutes : 10
93-
94- - name : Parse test results
95- if : always() && matrix.node-version == '20'
96- id : results
97- working-directory : sdks/typescript
98- run : |
99- PASSED=$(grep -oP '# pass \K\d+' test-output.txt | paste -sd+ | bc || echo "0")
100- echo "passed=${PASSED}" >> $GITHUB_OUTPUT
101-
102- update-badge :
103- name : Update test badge
104- needs : [python-tests, typescript-tests]
105- if : always() && github.ref == 'refs/heads/main'
106- runs-on : ubuntu-latest
107- steps :
108- - name : Calculate totals
109- id : totals
110- run : |
111- PY_PASSED="${{ needs.python-tests.outputs.passed }}"
112- PY_FAILED="${{ needs.python-tests.outputs.failed }}"
113- TS_PASSED="${{ needs.typescript-tests.outputs.passed }}"
114- PY_PASSED=${PY_PASSED:-0}
115- PY_FAILED=${PY_FAILED:-0}
116- TS_PASSED=${TS_PASSED:-0}
117- TOTAL=$((PY_PASSED + TS_PASSED))
118- if [ "$PY_FAILED" = "0" ] || [ -z "$PY_FAILED" ]; then
119- echo "color=brightgreen" >> $GITHUB_OUTPUT
120- echo "message=${TOTAL} passed" >> $GITHUB_OUTPUT
121- else
122- echo "color=red" >> $GITHUB_OUTPUT
123- echo "message=${TOTAL} passed, ${PY_FAILED} failed" >> $GITHUB_OUTPUT
124- fi
125-
126- - name : Update badge gist
127- uses : schneegans/dynamic-badges-action@v1.7.0
128- with :
129- auth : ${{ secrets.GIST_SECRET }}
130- gistID : ${{ vars.BADGE_GIST_ID }}
131- filename : lap-test-results.json
132- label : tests
133- message : ${{ steps.totals.outputs.message }}
134- color : ${{ steps.totals.outputs.color }}
0 commit comments