-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (48 loc) · 1.51 KB
/
django.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
name: Tests
on:
push:
branches: [ "main", "ci_testing" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r ci_testing/test_requirements.txt
pip install -r requirements.txt
- name: Run Tests
run: |
coverage run --source='.' ci_testing/mp_layers_testing/manage.py test layers.tests.test_models
- name: Set Coverage
id: set_coverage
run: |
COV=`coverage report --format=total`
echo "::set-output name=coverage::$COV"
# echo "$COV%"
# echo "{'coverage':$COV}" > /tmp/coverage_badge.json
# - name: Archive test coverage results
# uses: actions/upload-artifact@v4
# with:
# name: test-coverage-report_py-${{ matrix.python-version }}
# path: /tmp/coverage_badge.json
- name: Create Coverage Badge
uses: schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.COVERAGE_GIST_SECRET }}
gistID: 20cd92a8df1c63f3e6447540e67cddfd
filename: mpl_coverage.json
label: Coverage
message: "${{ steps.set_coverage.outputs.coverage }}"
color: green