Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GitHub actions #76

Merged
merged 8 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/backend-qa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Backend QA

on:
pull_request:
branches:
- main

permissions: read-all

jobs:
tests:
defaults:
run:
working-directory: ./backend
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DB_NAME: crumpet_db
DB_USERNAME: head_baker
DB_PASSWORD: Crumpet2023
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Docker Compose
run: docker compose -f docker-compose.dev.yml pull
- name: Build the Docker Compose environment
run: docker compose -f docker-compose.dev.yml build
- name: Run tests
run: docker compose -f docker-compose.dev.yml run web python manage.py test
24 changes: 0 additions & 24 deletions .github/workflows/backendQA.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/cancel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
steps:
- uses: styfle/[email protected]
with:
workflow_id: 'backendQA.yaml'
workflow_id: 'backend-qa.yaml'
58 changes: 0 additions & 58 deletions .github/workflows/frontendQA.yaml

This file was deleted.

24 changes: 12 additions & 12 deletions backend/.env.development
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# General settings
ENVIRONMENT = development
ENVIRONMENT=development

# Django settings
DEBUG = True
DEVELOPMENT_MODE = False # TODO: Delete this and update settings.py
DJANGO_ALLOWED_HOSTS = 'localhost,0.0.0.0,127.0.0.1,192.168.1.220'
DJANGO_SETTINGS_MODULE = backend.settings
DEBUG=True
DEVELOPMENT_MODE=False # TODO: Delete this and update settings.py
DJANGO_ALLOWED_HOSTS='localhost,0.0.0.0,127.0.0.1,192.168.1.220'
DJANGO_SETTINGS_MODULE=backend.settings

# Postgres settings
DB_NAME = crumpet_db
DB_USERNAME = head_baker
DB_PASSWORD = Crumpet2023
DB_HOST = db # Change this to localhost if not using docker
DB_PORT = 5432
DB_SSL_MODE = require
DB_NAME=crumpet_db
DB_USERNAME=head_baker
DB_PASSWORD=Crumpet2023
DB_HOST=db # Change this to localhost if not using docker
DB_PORT=5432
DB_SSL_MODE=require

# Redis settings for channels (websockets)
REDIS_CHANNELS_HOST = localhost
REDIS_CHANNELS_HOST=localhost
2 changes: 1 addition & 1 deletion backend/app/fields/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from person_schema_json_field import PersonSchemaJSONField
from .person_schema_json_field import PersonSchemaJSONField
1 change: 0 additions & 1 deletion backend/app/models/validators/__init__.py

This file was deleted.

135 changes: 0 additions & 135 deletions backend/app/models/validators/element_validators.py

This file was deleted.

11 changes: 3 additions & 8 deletions backend/app/tests/test_environments.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import uuid
from django.test import TestCase

from django.contrib.auth import get_user_model
from django.test import TestCase

from app.models import Environment, Project, ProjectMembership

User = get_user_model()
Expand All @@ -20,13 +22,6 @@ def test_environment_creation(self):
self.assertEqual(self.environment.name, "Staging")
self.assertEqual(self.environment.project, self.project)

def test_environment_identifier(self):
"""
Test if the environment gets a UUID identifier if not provided.
"""
self.assertIsNotNone(self.environment.identifier)
self.assertTrue(isinstance(self.environment.identifier, uuid.UUID))

def test_unique_together_constraint(self):
"""
Test the unique together constraint for identifier and project.
Expand Down
Loading