Skip to content

Commit

Permalink
Merge pull request #59 from uclahs-cds/nwiltsie-add-test-action
Browse files Browse the repository at this point in the history
Add GitHub action for pytest
  • Loading branch information
nwiltsie authored Jan 12, 2024
2 parents dcf0a86 + 62a70d8 commit 24eefac
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
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.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
- name: Test with pytest
run: |
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
if-no-files-found: error
# Use always() to always run this step to publish test results when
# there are test failures
if: ${{ always() }}
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ __pycache__
build

.vscode

venv

.env
junit

0 comments on commit 24eefac

Please sign in to comment.