diff --git a/.env.lhci b/.env.lhci new file mode 100644 index 00000000..512e3854 --- /dev/null +++ b/.env.lhci @@ -0,0 +1,13 @@ +SECRET_KEY='django-insecure-w!h85bp^$$e8gm%c23r!0%9i7yzd=6w$$s&ic+6!%306&kj8@k*5' +DEBUG='' +DB_HOST=localhost +ALLOWED_HOSTS=localhost +DB_PORT=5432 +DB_NAME=term_db +DB_USER=sadilar +DB_PASSWORD=sadilar +LOGGING_FILE=/home/runner/work/term_platform/term_platform/app/debug.log +LOGGING_HANDLERS_LEVEL=INFO +LOGGING_LOGGERS_LEVEL=INFO +LOGGING_LOGGERS_DJANGO_LEVEL=INFO +TESTING_DIR=/home/runner/work/term_platform/term_platform/app/general/tests/files/ diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index d49e1e31..25e73700 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -22,8 +22,10 @@ jobs: - 5432:5432 options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.12 - name: Install Dependencies run: | python -m pip install --upgrade pip @@ -63,3 +65,55 @@ jobs: run: | cd app/ python manage.py check + lighthouse: + runs-on: ubuntu-latest # operating system your code will run on + services: + postgres: + image: postgres:16 + env: + POSTGRES_USER: sadilar + POSTGRES_PASSWORD: sadilar + POSTGRES_DB: term_db + ports: + - 5432:5432 + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.12 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements-test.txt + sudo apt-get install -y gettext + npm install -g @lhci/cli@0.14.x + - name: Setup LHCI env + run: cp .env.lhci app/.env + - name: Run Django fixtures + run: | + cd app + python manage.py migrate --no-input + python manage.py loaddata fixtures/institution.json + python manage.py loaddata fixtures/language.json + python manage.py loaddata fixtures/projects.json + python manage.py loaddata fixtures/subjects.json + python manage.py import_documents general/tests/files/ + - name: Run Lighthouse + run: cd app && lhci autorun + - name: Archive Lighthouse results + if: always() # Ensure results are uploaded on failure too + uses: actions/upload-artifact@v4 + with: + name: lighthouse-report + path: app/.lighthouseci/ + include-hidden-files: true + - name: Archive Django logs + if: always() # Ensure logs are uploaded on failure too + uses: actions/upload-artifact@v4 + with: + name: django-logs + path: app/debug.log diff --git a/.gitignore b/.gitignore index 168936e7..cfb3489d 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,6 @@ app/media/ /logging/ /pdf_uploads/ /pdf_upload_completed/ + +# Generated Lighthouse CI artifacts +.lighthouseci/ diff --git a/Dockerfile-dev b/Dockerfile-dev index 468ce882..d8ecb0b4 100644 --- a/Dockerfile-dev +++ b/Dockerfile-dev @@ -18,11 +18,15 @@ RUN <

{{ item.description|truncatewords:30 }} - {% trans "Read more" %} + {% trans "More about the document" %}

{% if item.languages %} diff --git a/app/templates/app/projects.html b/app/templates/app/projects.html index 64a21c6a..5433e0bb 100644 --- a/app/templates/app/projects.html +++ b/app/templates/app/projects.html @@ -47,7 +47,7 @@

{{ item.description|truncatewords:30 }} - {% trans "Read more" %} + {% trans "More about the project" %}

{% if item.languages %} diff --git a/entrypoint.sh b/entrypoint.sh old mode 100644 new mode 100755