-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into bugfix/DBC22-1520
- Loading branch information
Showing
86 changed files
with
2,087 additions
and
604 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Unit tests & Sonar Scan | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
# pull_request: | ||
# types: [opened, synchronize, reopened] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-latest | ||
name: Run Tests | ||
timeout-minutes: 10 | ||
services: | ||
redis: | ||
image: redis:7 | ||
ports: | ||
- 6379:6379 | ||
postgres: | ||
image: postgis/postgis:15-3.4 | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_PASSWORD: testpw | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
# Disabling shallow clone is recommended for improving relevancy of reporting for SonarCloud | ||
fetch-depth: 0 | ||
- name: Install GDAL | ||
run: sudo apt-get install -y gdal-bin | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r ./src/backend/requirements/development.txt | ||
- name: Run Tests | ||
env: | ||
DB_NAME: postgres | ||
DB_USER: postgres | ||
DB_PASSWORD: testpw | ||
DB_HOST: localhost | ||
DB_PORT: 5432 | ||
REDIS_HOST: localhost | ||
REDIS_PORT: 6379 | ||
DEBUG: false | ||
DJANGO_URL: http://localhost:8000 | ||
DJANGO_ALLOWED_HOSTS: localhost | ||
DJANGO_CORS_ORIGIN_WHITELIST: http://localhost:8000,http://localhost:3000 | ||
DJANGO_SUPERUSER_USERNAME: testvar | ||
DJANGO_SUPERUSER_EMAIL: testvar@testvar.com | ||
DJANGO_SUPERUSER_PASSWORD: testvar | ||
DJANGO_CSRF_COOKIE_SECURE: false | ||
DJANGO_SECURE_SSL_REDIRECT: false | ||
DJANGO_SESSION_COOKIE_SECURE: false | ||
DJANGO_EMAIL_BACKEND: django.core.mail.backends.console.EmailBackend | ||
DJANGO_EMAIL_HOST: testvar | ||
DJANGO_EMAIL_PORT: 1 | ||
DJANGO_RECAPTCHA_SECRET_KEY: testvar | ||
DJANGO_FEEDBACK_EMAIL_DEFAULT: testvar@testvar.com | ||
DRIVEBC_INLAND_FERRY_API_BASE_URL: testvar | ||
DRIVEBC_IMAGE_API_BASE_URL: testvar | ||
DRIVEBC_IMAGE_PROXY_URL: testvar | ||
DRIVEBC_OPEN_511_API_BASE_URL: testvar | ||
DRIVEBC_WEBCAM_API_BASE_URL: testvar | ||
DRIVEBC_ROUTE_PLANNER_API_BASE_URL: testvar | ||
DRIVEBC_ROUTE_PLANNER_API_AUTH_KEY: testvar | ||
DRIVEBC_DIT_API_BASE_URL: testvar | ||
DRIVEBC_WEATHER_API_BASE_URL: testvar | ||
DRIVEBC_WEATHER_API_TOKEN_URL: testvar | ||
WEATHER_CLIENT_ID: testvar | ||
WEATHER_CLIENT_SECRET: testvar | ||
DRIVEBC_WEATHER_AREAS_API_BASE_URL: testvar | ||
SECRET_KEY: testvar | ||
run: | | ||
coverage run ./src/backend/manage.py test --noinput && coverage report && coverage xml | ||
- name: Override Coverage Source Path for Sonar | ||
run: | | ||
sed -i "s/<source>\/home\/runner\/work\/DriveBC.ca\/DriveBC.ca<\/source>/<source>\/github\/workspace<\/source>/g" /home/runner/work/DriveBC.ca/DriveBC.ca/coverage.xml | ||
- name: SonarCloud Scan | ||
uses: SonarSource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# file based env values | ||
.env | ||
.env.backup | ||
|
||
# Build files | ||
*.pyc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
SHELL := /bin/bash | ||
.PHONY: help down | ||
ARCH := $(shell uname -m) | ||
|
||
help: ## This help. | ||
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | ||
|
||
.DEFAULT_GOAL := help | ||
|
||
up: ## Bring up containers | ||
@echo 'Starting containers...' | ||
@if [ "$(ARCH)" = "arm64" ]; then \ | ||
docker-compose -f docker-compose.yml -f docker-compose.m1.yml up -d; \ | ||
else \ | ||
docker-compose up -d; \ | ||
fi | ||
|
||
down: ## Stop and remove containers and volumes | ||
@echo 'Removing containers and volumes...' | ||
docker-compose down -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
services: | ||
db: | ||
image: tobi312/rpi-postgresql-postgis:15-3.4-alpine-arm | ||
django: | ||
platform: linux/amd64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/backend/apps/cms/migrations/0015_alter_advisory_geometry.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 4.2.3 on 2024-02-14 14:45 | ||
|
||
import django.contrib.gis.db.models.fields | ||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('cms', '0014_bulletin_image_alt_text'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='advisory', | ||
name='geometry', | ||
field=django.contrib.gis.db.models.fields.PolygonField(srid=4326), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.