| 1 | name: Run Tests |
| 2 | |
| 3 | on: |
| 4 | pull_request: |
| 5 | branches: |
| 6 | - main |
| 7 | |
| 8 | jobs: |
| 9 | test: |
| 10 | runs-on: ubuntu-latest |
| 11 | |
| 12 | steps: |
| 13 | - name: Checkout code |
| 14 | uses: actions/checkout@v2 |
| 15 | |
| 16 | - name: Set up Python |
| 17 | uses: actions/setup-python@v2 |
| 18 | with: |
| 19 | python-version: 3.10.13 |
| 20 | - name: Install Poetry |
| 21 | run: | |
| 22 | pip install poetry coverage |
| 23 | poetry config virtualenvs.create false |
| 24 | |
| 25 | - name: Run unittest tests |
| 26 | run: coverage run -m unittest discover -s tests |
| 27 | |
| 28 | - name: Upload Coverage to Codecov |
| 29 | uses: codecov/codecov-action@v2 |
| 30 | with: |
| 31 | token: ${{ secrets.CODECOV_TOKEN }} |