Skip to content

Commit

Permalink
Merge branch 'main' into suggestion-bot
Browse files Browse the repository at this point in the history
  • Loading branch information
SahilDhillon21 authored Jan 8, 2025
2 parents 3f266cc + 6c7c2ff commit 2147819
Show file tree
Hide file tree
Showing 27 changed files with 1,355 additions and 1,197 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
restore-keys: |
${{ runner.os }}-poetry-
- name: Print memory usage
run: free -h

pre-commit:
name: Run pre-commit
needs: setup
Expand All @@ -69,6 +72,8 @@ jobs:
python-version: 3.11.2
- name: Run pre-commit
uses: pre-commit/action@v3.0.1
- name: Print memory usage
run: free -h

code-ql:
name: Run CodeQL
Expand Down Expand Up @@ -132,6 +137,9 @@ jobs:
- uses: github/codeql-action/analyze@v2
if: ${{ steps.set-matrix.outputs.languages != '' }}

- name: Print memory usage
run: free -h

test:
name: Run Tests
needs: code-ql
Expand All @@ -147,11 +155,13 @@ jobs:
with:
python-version: 3.11.2
- run: pip install poetry
- run: poetry lock --no-update
- run: poetry lock
- run: poetry install
- run: poetry run python manage.py collectstatic --noinput
- name: Run tests
run: poetry run xvfb-run --auto-servernum python manage.py test -v 3 --failfast
- name: Print memory usage
run: free -h

docker-test:
runs-on: ubuntu-latest
Expand All @@ -176,10 +186,13 @@ jobs:
docker run -d --name my-container my-app
- run: docker exec my-container pip install poetry
- run: docker exec my-container poetry lock --no-update
- run: docker exec my-container poetry install --no-dev --no-interaction
- run: docker exec my-container poetry lock
- run: docker exec my-container poetry install --without dev --no-interaction

- name: Clean up
run: |
docker stop my-container
docker rm my-container
docker rm my-container
- name: Print memory usage
run: free -h
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ RUN ln -s /usr/bin/google-chrome-stable /usr/local/bin/google-chrome
RUN pip install poetry
RUN poetry config virtualenvs.create false
COPY pyproject.toml poetry.lock* ./
RUN poetry lock --no-update
RUN poetry install
RUN poetry lock
RUN poetry install --no-root

# Install additional Python packages
RUN pip install opentelemetry-api opentelemetry-instrumentation
Expand Down
3 changes: 2 additions & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
release: python manage.py migrate --noinput
web: bin/start-pgbouncer uvicorn blt.asgi:application --host 0.0.0.0 --port ${PORT}
#web: newrelic-admin run-program bin/start-pgbouncer uvicorn blt.asgi:application --host 0.0.0.0 --port ${PORT}
web: gunicorn blt.wsgi --log-file - --workers 1 --worker-class gthread --threads 2 --timeout 120
3 changes: 3 additions & 0 deletions blt/asgi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# asgi.py

import os
import tracemalloc

import django

Expand All @@ -12,6 +13,8 @@
from django.core.asgi import get_asgi_application
from django.urls import path

tracemalloc.start()

from website import consumers # You will define a consumer for handling WebSockets

application = ProtocolTypeRouter(
Expand Down
Loading

0 comments on commit 2147819

Please sign in to comment.