Skip to content

Commit 07eb1e5

Browse files
authored
Merge pull request #7 from Ecotrust/merge2025
Portal Sync - Merge2025
2 parents 5894a87 + 5b4c18b commit 07eb1e5

File tree

103 files changed

+32573
-1585
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+32573
-1585
lines changed

.github/settings.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
INSTALLED_APPS = [
2+
3+
# ...
4+
5+
'corsheaders',
6+
7+
# ...
8+
9+
]
10+
11+
12+
MIDDLEWARE = [
13+
14+
# ...
15+
16+
'corsheaders.middleware.CorsMiddleware',
17+
18+
# ...
19+
20+
]
21+
22+
CORS_ALLOWED_ORIGINS = [
23+
"http://localhost:3000", # Add the port your React app runs on
24+
]
25+
26+
CORS_ORIGIN_WHITELIST = [
27+
'http://localhost:3000', # The default port for create-react-app
28+
]

.github/workflows/django.yml

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Django CI
1+
name: Tests
22

33
on:
44
push:
5-
branches: [ "main", "ci_testing" ]
5+
branches: [ "main", "ci_testing", "Vanilla_layers" ]
66
pull_request:
7-
branches: [ "main" ]
7+
branches: [ "main", "Vanilla_layers" ]
88

99
jobs:
1010
build:
@@ -13,12 +13,12 @@ jobs:
1313
strategy:
1414
max-parallel: 4
1515
matrix:
16-
python-version: [3.7, 3.8, 3.9]
16+
python-version: [3.10.12]
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v3
21+
uses: actions/setup-python@v5
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424
- name: Install Dependencies
@@ -28,4 +28,32 @@ jobs:
2828
pip install -r requirements.txt
2929
- name: Run Tests
3030
run: |
31-
python ci_testing/mp_layers_testing/manage.py test layers.tests.test_models
31+
coverage run --source='.' ci_testing/mp_layers_testing/manage.py test layers.tests.test_models
32+
- name: Set Coverage
33+
id: set_coverage
34+
run: |
35+
COV=`coverage report --format=total`
36+
echo "coverage=$COV" >> $GITHUB_OUTPUT
37+
# echo "$COV%"
38+
# echo "{'coverage':$COV}" > /tmp/coverage_badge.json
39+
# - name: Archive test coverage results
40+
# uses: actions/upload-artifact@v4
41+
# with:
42+
# name: test-coverage-report_py-${{ matrix.python-version }}
43+
# path: /tmp/coverage_badge.json
44+
- name: Create Coverage Badge
45+
uses: schneegans/dynamic-badges-action@v1.7.0
46+
with:
47+
auth: ${{ secrets.COVERAGE_GIST_SECRET }}
48+
gistID: 20cd92a8df1c63f3e6447540e67cddfd
49+
filename: mpl_coverage.json
50+
label: Coverage
51+
message: "${{ steps.set_coverage.outputs.coverage }}%"
52+
color: green
53+
# TODO: Set IF sections to change colors:
54+
# >= 95: 'green'
55+
# >= 90: 'yellow'
56+
# >= 80: 'orange'
57+
# <80: 'red'
58+
59+

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# mp_layers
22
Madrona Portal's Layer Manager
3+
4+
[![Test Build](https://github.com/Ecotrust/mp-layers/actions/workflows/django.yml/badge.svg?branch=main)](https://github.com/Ecotrust/mp-layers/actions/workflows/django.yml)
5+
![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/rhodges/20cd92a8df1c63f3e6447540e67cddfd/raw/mpl_coverage.json)

ci_testing/test_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
django<4.0
2+
coverage
23
-e ./

0 commit comments

Comments
 (0)