Skip to content

Commit 72e687b

Browse files
authored
Merge pull request #17 from jdb78/test/coverage
Add automatic coverage report to tests
2 parents 17344d0 + 834a949 commit 72e687b

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

.github/workflows/test.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ on:
1111

1212
jobs:
1313
build:
14-
runs-on: ubuntu-latest
14+
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17+
os: [ubuntu-18.04, macOS-10.15] # add windows-2019 when poetry allows installation with `-f` flag
1718
python-version: [3.7, 3.8]
1819

1920
steps:
@@ -24,6 +25,16 @@ jobs:
2425
with:
2526
python-version: ${{ matrix.python-version }}
2627

28+
- name: Setup macOS
29+
if: runner.os == 'macOS'
30+
run: |
31+
brew install libomp # https://github.com/pytorch/pytorch/issues/20030
32+
33+
- name: Setup macOS
34+
if: runner.os == 'windows'
35+
run: |
36+
brew install libomp # https://github.com/pytorch/pytorch/issues/20030
37+
2738
- name: Get full Python version
2839
id: full-python-version
2940
shell: bash
@@ -63,6 +74,23 @@ jobs:
6374
shell: bash
6475
run: poetry run pytest tests
6576

77+
- name: Statistics
78+
if: success()
79+
run: |
80+
pip install coverage
81+
coverage report
82+
coverage xml
83+
84+
- name: Upload coverage to Codecov
85+
uses: codecov/codecov-action@v1
86+
if: always()
87+
with:
88+
token: ${{ secrets.CODECOV_TOKEN }}
89+
file: coverage.xml
90+
flags: cpu,pytest
91+
name: CPU-coverage
92+
fail_ci_if_error: false
93+
6694
docs:
6795
name: Test docs build
6896
runs-on: ubuntu-latest

setup.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ markers =
5656
[coverage:report]
5757
ignore_errors = False
5858
show_missing = True
59-
omit =
60-
temporal_fusion_transformer_pytorch/_version.py
61-
*testing.py
6259

6360

6461
[mypy]

0 commit comments

Comments
 (0)