Skip to content

Commit

Permalink
PyTest action (#25)
Browse files Browse the repository at this point in the history
* PyTest action
* Rename action to "Unit Tests"
* Use python version correctly in action
* Use Python version in job name

---------

Signed-off-by: tennlee <[email protected]>
  • Loading branch information
tennlee authored Aug 10, 2023
1 parent 3fee1b9 commit 5f62616
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Unit Tests

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install .[all]
- name: Test with pytest
run: |
pip install pytest pytest-cov
pytest --cov-report html --cov=src --junitxml=junit/test-results.xml --junitxml=junit/test-results.xml

0 comments on commit 5f62616

Please sign in to comment.