generated from armand-sauzay/python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (44 loc) · 1.26 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
name: Testing
on:
pull_request:
branches:
- main
workflow_call:
jobs:
Testing:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
# check out repo
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
# install poetry
- name: Install poetry
run: pipx install poetry==${{ vars.POETRY_VERSION }}
# set up python with cache
- name: Setup python ${{ vars.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ vars.PYTHON_VERSION }}
cache: 'poetry'
# Install requirements (including dev-dependencies)
- name: Install requirements
run: poetry install --with test
# Run unit-tests
- name: Run unit-tests
run: |
set -o pipefail
poetry run make unit-tests-cov-fail
# Add pytest coverage report to PR
- name: Pytest coverage comment
if: ${{ success() && github.event_name == 'pull_request' }}
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
with:
title: Coverage Report
pytest-coverage-path: pytest-coverage.txt
junitxml-path: pytest.xml