Skip to content

Added coverage badge? (#10) #46

Added coverage badge? (#10)

Added coverage badge? (#10) #46

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
# 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