-
Notifications
You must be signed in to change notification settings - Fork 33
36 lines (33 loc) · 1.05 KB
/
coverage.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
name: Coverage
# This workflow generates a coverage report (how much of the codebase is covered by the
# unit tests) and posts headline metrics to the PR thread.
on:
# push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install ChoiceModels
run: |
pip install .
pip install orca urbansim # extra tests run if urbansim is present
- name: Generate coverage report
run: |
pip install pytest coverage
coverage run --source choicemodels --module pytest --verbose
coverage report --show-missing
echo "coverage=$(coverage report | grep '^TOTAL' | grep -oE '[^ ]+$')" >> $GITHUB_ENV
- name: Post comment on PR
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: "Test coverage is ${{ env.coverage }}"
check_for_duplicate_msg: true