Skip to content

support pytest (#3)

support pytest (#3) #2

Workflow file for this run

name: Pytest
on: [push, pull_request, workflow_dispatch]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
# Install and Test Example
- name: Install and Test Example
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov
- name: Test
run: |
cd example
python -m pytest --cov --cov-report json
cp -r coverage.json ..
cd ..
# 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: ./