-
Notifications
You must be signed in to change notification settings - Fork 17
59 lines (49 loc) · 1.41 KB
/
drip-coverage.yaml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Django Tests
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
test:
runs-on: ubuntu-latest
env:
# Set the secret for the code coverage tool
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
strategy:
matrix:
python-version: ["3.12"]
steps:
# Check out the code from the repository
- name: Checkout code
uses: actions/checkout@v3
# Set up Python environment
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install django==4.2
pip install -r github-actions-requirements.txt
# Prepare code coverage reporting
- name: Install Code Climate Test Reporter
run: |
pip install codeclimate-test-reporter
codeclimate-test-reporter before-build
# Run tests
- name: Run tests with coverage
run: |
coverage run manage.py test
coverage report
# Upload coverage data to Code Climate
- name: Upload coverage to Code Climate
run: |
coverage xml
codeclimate-test-reporter after-build --exit-code ${{ job.status }}