Skip to content

Commit dc6e1a1

Browse files
committed
chore: fix CI running coverage
1 parent 4186e87 commit dc6e1a1

File tree

2 files changed

+59
-30
lines changed

2 files changed

+59
-30
lines changed

.coveragerc

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[run]
2+
branch = True
3+
source = drf_kit
4+
omit = */test_app/*
5+
6+
[report]
7+
exclude_lines =
8+
if self.debug:
9+
if settings.DEBUG
10+
raise AssertionError
11+
raise NotImplementedError
12+
if 0:
13+
if __name__ == .__main__.:
14+
15+
[html]
16+
directory = html-coverage

.github/workflows/main.yaml

+43-30
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,35 @@ jobs:
1212
linter:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v1
16-
17-
- name: Set up Python 3.8
18-
uses: actions/setup-python@v1
19-
with:
20-
python-version: 3.8
21-
22-
- name: Cache dependencies
23-
uses: actions/cache@v1
24-
with:
25-
path: ~/.cache/pypoetry
26-
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }}
15+
- uses: actions/checkout@v1
16+
- name: Set up Python 3.9
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: 3.9
2720

28-
- name: Install Python dependencies
29-
run: |
30-
make dependencies
31-
env:
32-
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
21+
- name: Cache dependencies
22+
uses: actions/cache@v1
23+
with:
24+
path: ~/.cache/pypoetry
25+
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }}
3326

34-
- name: Lint with pylint
35-
run: |
36-
make lint
27+
- name: Install Python dependencies
28+
run: |
29+
make dependencies
30+
env:
31+
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
32+
- name: Lint with pylint
33+
run: |
34+
make lint
3735
3836
setup:
3937
runs-on: ubuntu-latest
4038
steps:
4139
- uses: actions/checkout@v1
42-
43-
- name: Set up Python 3.8
40+
- name: Set up Python 3.9
4441
uses: actions/setup-python@v1
4542
with:
46-
python-version: 3.8
43+
python-version: 3.9
4744

4845
- name: Cache dependencies
4946
uses: actions/cache@v1
@@ -56,38 +53,54 @@ jobs:
5653
make dependencies
5754
env:
5855
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
59-
60-
- name: Build the package
56+
- name: Install as a package
6157
run: |
6258
poetry build
6359
6460
unit:
6561
runs-on: ubuntu-latest
62+
services:
63+
postgres:
64+
image: postgres:11
65+
env:
66+
POSTGRES_USER: postgres
67+
POSTGRES_PASSWORD: postgres
68+
POSTGRES_DB: sample_app
69+
ports:
70+
- 5432:5432
71+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
6672

6773
steps:
6874
- uses: actions/checkout@v1
6975

70-
- name: Set up Python 3.8
76+
- name: Set up Python 3.9
7177
uses: actions/setup-python@v1
7278
with:
73-
python-version: 3.8
79+
python-version: 3.9
7480

75-
- name: Install Python dependencies
81+
- name: Cache dependencies
82+
uses: actions/cache@v1
83+
with:
84+
path: ~/.cache/pypoetry
85+
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }}
86+
87+
- name: Install dependencies
7688
run: |
7789
make dependencies
7890
env:
7991
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
8092

81-
- name: Prepare coverage
93+
- name: Prepare CodeClimate
8294
run: |
8395
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
8496
chmod +x ./cc-test-reporter
8597
./cc-test-reporter before-build
8698
87-
- name: Unit test with nose test suite
99+
- name: Unit test with Django test suite
88100
run: |
89101
make unit
90102
env:
103+
DATABASE_URL: postgres://postgres:postgres@localhost:5432/sample_app
91104
LOG_LEVEL: ERROR
92105

93106
- name: Report coverage

0 commit comments

Comments
 (0)