Skip to content

Coverage badge (#11) #48

Coverage badge (#11)

Coverage badge (#11) #48

Workflow file for this run

name: Study lyte testing
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update
python -m pip install --upgrade pip
python -m pip install pytest coverage
python setup.py install
- name: Test with pytest
run: |
pytest -s ./tests/
- name: Run coverage
run: |
coverage run --source study_lyte -m pytest
coverage json -o ./coverage/coverage-summary.json
# Add this
- name: Update Coverage Badge
# GitHub actions: default branch variable
# https://stackoverflow.com/questions/64781462/github-actions-default-branch-variable
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
uses: we-cli/coverage-badge-action@main