Skip to content

Commit 80fdaa5

Browse files
authored
Merge pull request #29 from gnikit/featture/coverage
Featture/coverage
2 parents f86d22c + 3526358 commit 80fdaa5

File tree

7 files changed

+40
-3
lines changed

7 files changed

+40
-3
lines changed

.coveragerc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[run]
2+
dynamic_context = test_function
3+
omit = fortls/__init__.py

.github/workflows/main.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Tests
22

3-
on: [push, pull_request]
3+
on:
4+
[push, pull_request]
45
# Allows you to run this workflow manually from the Actions tab
56
# workflow_dispatch:
67

@@ -27,4 +28,24 @@ jobs:
2728
run: pytest -v
2829

2930
- name: Lint
30-
run: black --diff --check --verbose .
31+
run: black --diff --check --verbose .
32+
33+
coverage:
34+
runs-on: ubuntu-latest
35+
36+
steps:
37+
- uses: actions/checkout@v2
38+
- uses: actions/setup-python@v2
39+
with:
40+
python-version: "3.10"
41+
42+
- name: Coverage report
43+
run: |
44+
pip install -r test_requirements.txt
45+
pytest --cov=fortls --cov-report=xml
46+
47+
- name: Upload coverage to Codecov
48+
uses: codecov/codecov-action@v2
49+
with:
50+
token: ${{ secrets.CODECOV_TOKEN }}
51+
fail_ci_if_error: true

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ docs/fortls_changes.md
1010
*.o
1111
*.mod
1212
*.smod
13-
*.log
13+
*.log
14+
15+
.coverage

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# CHANGELONG
22

3+
## Unreleased
4+
5+
### Added
6+
7+
- Added coverage metric for Codecov
8+
39
## 2.0.1
410

511
### Added

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
max-line-length = 88
3+
extend-ignore = E203,E722

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"Natural Language :: English",
3535
"Programming Language :: Python",
3636
"Programming Language :: Python :: 3",
37+
"Programming Language :: Python :: 3.7",
3738
"Programming Language :: Python :: 3.8",
3839
"Programming Language :: Python :: 3.9",
3940
"Programming Language :: Python :: 3.10",

test_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
black
22
pytest
3+
pytest-cov

0 commit comments

Comments
 (0)