forked from henami2207/demo
-
Notifications
You must be signed in to change notification settings - Fork 7
59 lines (48 loc) · 2.15 KB
/
CI.yml
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: CI
on:
pull_request:
push:
branches:
- master
jobs:
run-tests:
runs-on: [ubuntu-latest]
env:
DEEPSOURCE_DSN_DEV: ${{ secrets.DEEPSOURCE_DSN_DEV }}
DEEPSOURCE_DSN_ENTERPRISE_DEV: ${{ secrets.DEEPSOURCE_DSN_ENTERPRISE_DEV }}
DEEPSOURCE_DSN_PROD: ${{ secrets.DEEPSOURCE_DSN_PROD }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up python3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Run tests
run: |
pip install pytest-cov django
pytest --cov=./ --cov-report=xml
- name: Report test coverage to DeepSource dev (python, go, js, php)
run: |
curl https://deepsource.io/cli | sh
export DEEPSOURCE_DSN=$DEEPSOURCE_DSN_DEV
./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml
./bin/deepsource report --analyzer test-coverage --key go --value-file ./go_coverage.out
./bin/deepsource report --analyzer test-coverage --key javascript --value-file ./js_coverage.xml
./bin/deepsource report --analyzer test-coverage --key php --value-file ./php_coverage.xml
- name: Report test coverage to DeepSource dev enterprise (python)
run: |
curl https://deepsource.io/cli | sh
export DEEPSOURCE_DSN=$DEEPSOURCE_DSN_ENTERPRISE_DEV
./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml
- name: Report test coverage to DeepSource prod (python, go, js, php)
run: |
curl https://deepsource.io/cli | sh
export DEEPSOURCE_DSN=$DEEPSOURCE_DSN_PROD
./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml
./bin/deepsource report --analyzer test-coverage --key go --value-file ./go_coverage.out
./bin/deepsource report --analyzer test-coverage --key javascript --value-file ./js_coverage.xml
./bin/deepsource report --analyzer test-coverage --key php --value-file ./php_coverage.xml