DOC: include missing pages to reference docs #33
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
name: tests | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Build treams with tracing | |
run: CYTHON_COVERAGE=1 python -m pip install -e . | |
- name: Run tests | |
run: | | |
python -m pip install treams[test,coverage,io] | |
python -m pytest tests/unit --cov src/treams --cov-report html | |
- name: Get coverage report | |
run: | | |
python -m coverage json | |
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])") | |
echo -n "{ \"schemaVersion\": 1, \"label\": \"coverage\", \"message\": \"$TOTAL%\", \"color\": \"" > htmlcov/endpoint.json | |
if [ "$TOTAL" -lt 60 ]; then echo -n "red" >> htmlcov/endpoint.json; \ | |
elif [ "$TOTAL" -lt 70 ]; then echo -n "orange" >> htmlcov/endpoint.json; \ | |
elif [ "$TOTAL" -lt 80 ]; then echo -n "yellow" >> htmlcov/endpoint.json; \ | |
elif [ "$TOTAL" -lt 90 ]; then echo -n "yellowgreen" >> htmlcov/endpoint.json; \ | |
elif [ "$TOTAL" -lt 95 ]; then echo -n "green" >> htmlcov/endpoint.json; \ | |
else echo -n "brightgreen" >> htmlcov/endpoint.json; fi | |
echo "\" }" >> htmlcov/endpoint.json | |
rm htmlcov/.gitignore | |
- name: Deploy report | |
uses: s0/git-publish-subdir-action@develop | |
env: | |
REPO: self | |
BRANCH: htmlcov | |
FOLDER: htmlcov | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |