Skip to content

Commit 9cfae58

Browse files
committed
Add code coverage step
1 parent 1814445 commit 9cfae58

File tree

1 file changed

+25
-16
lines changed

1 file changed

+25
-16
lines changed

.github/workflows/main.yml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ name: CI
66
# events but only for the master branch
77
on:
88
push:
9-
branches: [ master ]
9+
branches: [master]
1010
pull_request:
11-
branches: [ master ]
11+
branches: [master]
1212

1313
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1414
jobs:
@@ -19,22 +19,31 @@ jobs:
1919

2020
# Steps represent a sequence of tasks that will be executed as part of the job
2121
steps:
22-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23-
- uses: actions/checkout@v2
22+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23+
- uses: actions/checkout@v2
2424

25-
- name: Set up Python
26-
uses: actions/setup-python@v2
27-
with:
28-
python-version: '3.x'
25+
- name: Set up Python
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: "3.x"
2929

30-
- name: Install global dependencies
31-
run: python -m pip install -U pip setuptools wheel
30+
- name: Install global dependencies
31+
run: python -m pip install -U pip setuptools wheel
3232

33-
- name: Install deps
34-
run: pip install -r requirements.txt
33+
- name: Install deps
34+
run: pip install -r requirements.txt
3535

36-
- name: Install password_validator
37-
run: pip install .
36+
- name: Install dev deps
37+
run: pip install -r requirements-dev.txt
3838

39-
- name: Run tests
40-
run: python -m unittest discover tests -v
39+
- name: Install password_validator
40+
run: pip install .
41+
42+
- name: Run tests
43+
run: coverage run --source src -m unittest discover -s tests -v
44+
45+
- name: Generate coverage report
46+
run: coverage report
47+
48+
- name: Upload coverage report to Codecov
49+
uses: codecov/codecov-action@v1

0 commit comments

Comments
 (0)