Skip to content

Add 100% coverage

Add 100% coverage #179

Workflow file for this run

name: test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
name: ${{ matrix.os }} python-${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup conda environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-dev.yml
environment-name: pycrdt
create-args: python=${{ matrix.python-version }}
- name: Build and install pycrdt
run: pip install .[test]
- name: Check types
run: mypy python
- name: Run tests
run: |
pytest --color=yes -v tests
- name: Code coverage
with:
python-version: '3.12'
run: |
coverage run -m pytest --color=yes -v tests
coverage report --show-missing --skip-covered
coverage json
- name: Upload coverage data
uses: actions/upload-artifact@v4

Check failure on line 55 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/test.yml

Invalid workflow file

You have an error in your yaml syntax on line 55
with:
name: covdata
path: coverage.json
# coverage:
# name: Coverage
# needs: test
# runs-on: ubuntu-latest
# steps:
# - name: "Checkout repository"
# uses: actions/checkout@v3
#
# - name: "Set up Python"
# uses: actions/setup-python@v5
# with:
# python-version: "3.12"
#
# - name: "Download coverage data"
# uses: actions/download-artifact@v4
# with:
# name: covdata
#
# - name: "Combine"
# 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
#
# - name: "Make badge"
# uses: schneegans/[email protected]
# with:
# auth: ${{ secrets.GIST_TOKEN }}
# gistID: b7b1bad6a6ad7c2ae651b201119f1c27
# filename: covbadge.json
# label: Coverage
# message: ${{ env.total }}%
# minColorRange: 50
# maxColorRange: 90
# valColorRange: ${{ env.total }}