Skip to content

Add GitHub action for pytest #4

Add GitHub action for pytest

Add GitHub action for pytest #4

Workflow file for this run

---
name: pytest
on:
pull_request:
branches:
- main
jobs:
pytest:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with pytest
run: |
pip install pytest
pytest test \
--doctest-modules \
--junitxml=junit/test-results.xml
- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: test-results.xml
path: junit/test-results.xml
# Use always() to always run this step to publish test results when
# there are test failures
if: ${{ always() }}