-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.5 KB
/
test.yml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
# This workflow runs the testing of the package using pytest, computes the test coverage, and
# comments the coverage results on GitHub.
name: Test
on:
# Note that push on main should be protected against
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- reopened
- ready_for_review
- synchronize
jobs:
test:
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Test with pytest
run: |
poetry run pytest --junitxml=pytest.xml > pytest.txt
- name: Display Pytest's output
if: ${{ always() }}
run: |
cat pytest.txt
- name: Comment the coverage
uses: MishaKav/[email protected]
with:
pytest-coverage-path: pytest.txt
junitxml-path: pytest.xml
title: ai-template coverage report
badge-title: ai_template coverage
create-new-comment: true
report-only-changed-files: false # Setting this to true would be interesting, but the changed files display doesn't work well for now