mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-08 07:18:47 +00:00
Add CI test script and update workflow
This commit is contained in:
11
.github/workflows/python-ci.yml
vendored
11
.github/workflows/python-ci.yml
vendored
@@ -81,10 +81,15 @@ jobs:
|
|||||||
if: github.ref == 'refs/heads/main' || github.event_name == 'schedule'
|
if: github.ref == 'refs/heads/main' || github.event_name == 'schedule'
|
||||||
run: echo "NOSTR_E2E=1" >> $GITHUB_ENV
|
run: echo "NOSTR_E2E=1" >> $GITHUB_ENV
|
||||||
- name: Run tests with coverage
|
- name: Run tests with coverage
|
||||||
|
timeout-minutes: 16
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: scripts/run_ci_tests.sh
|
||||||
pytest ${STRESS_ARGS} --cov=src --cov-report=xml --cov-report=term-missing \
|
- name: Upload pytest log
|
||||||
--cov-fail-under=20 src/tests
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: pytest-log-${{ matrix.os }}
|
||||||
|
path: pytest.log
|
||||||
- name: Upload coverage report
|
- name: Upload coverage report
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
12
scripts/run_ci_tests.sh
Executable file
12
scripts/run_ci_tests.sh
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eo pipefail
|
||||||
|
timeout 15m pytest -vv ${STRESS_ARGS} \
|
||||||
|
--cov=src --cov-report=xml --cov-report=term-missing \
|
||||||
|
--cov-fail-under=20 src/tests 2>&1 | tee pytest.log
|
||||||
|
status=${PIPESTATUS[0]}
|
||||||
|
if [[ $status -eq 124 ]]; then
|
||||||
|
echo "::error::Tests exceeded 15-minute limit"
|
||||||
|
tail -n 20 pytest.log
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
exit $status
|
Reference in New Issue
Block a user