generated from pollen-robotics/python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhancement #46: run tests with server in background
- Loading branch information
1 parent
c1d351e
commit 7dcfefb
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,26 @@ jobs: | |
run: | | ||
python -m pip install --upgrade pip | ||
pip install .[dev] | ||
- name: Unit tests | ||
uses: BerniWittmann/background-server-action@v1 | ||
with: | ||
command: coverage run -m pytest, coverage xml, coverage json, coverage html | ||
start: cd gst-plugins-rs/net/webrtc/signalling/, cargo run --bin gst-webrtc-signalling-server | ||
wait-on: 'http://localhost:8443' | ||
|
||
- name: Archive code coverage html report | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: code-coverage-report | ||
path: htmlcov | ||
- name: Get Cover | ||
uses: orgoro/[email protected] | ||
with: | ||
coverageFile: coverage.xml | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract results | ||
run: | | ||
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])") | ||
echo "total=$TOTAL" >> $GITHUB_ENV | ||
echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY |