Skip to content

Commit

Permalink
Merge branch 'master' into feature/jquery3
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Muller committed Oct 5, 2024
2 parents 689d6ee + 9aa7065 commit 6c46f42
Show file tree
Hide file tree
Showing 72 changed files with 5,528 additions and 2,753 deletions.
175 changes: 54 additions & 121 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,160 +3,93 @@ name: Django CI
on: [push, pull_request]

jobs:
postgres:

runs-on: ubuntu-latest

services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432

name: Postgres - Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }} (Allowed Failures - ${{ matrix.django-version == 'main' }} )
non-selenium-tests:
strategy:
max-parallel: 4
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
django-version: ['3.2.0', '4.0.0', '4.1.0', '4.2.0', 'main']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
django-version: ['3.2.0', '4.0.0', '4.1.0', '4.2.0', '5.0.0', 'main']
exclude:
- django-version: '4.0.0'
python-version: '3.7'
- django-version: '4.1.0'
python-version: '3.7'
- django-version: '4.2.0'
python-version: '3.8'
- django-version: '4.2.0'
python-version: '3.7'
- django-version: 'main'
python-version: '3.7'
- django-version: 'main'
python-version: '3.8'
- django-version: 'main'
python-version: '3.9'
- django-version: '5.0.0'
python-version: '3.8'
- django-version: '5.0.0'
python-version: '3.9'
- django-version: '3.2.0'
python-version: '3.11'
- django-version: '4.0.0'
python-version: '3.11'
- django-version: '3.2.0'
python-version: '3.12'
- django-version: '4.0.0'
python-version: '3.12'
- django-version: '4.1.0'
python-version: '3.12'
uses: ./.github/workflows/run_tests.yml
with:
python-version: ${{ matrix.python-version }}
django-version: ${{ matrix.django-version }}

translations:
runs-on: ubuntu-latest
name: Compile Translations
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
continue-on-error: ${{ matrix.django-version == 'main' }}
python-version: '3.11'
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt
- name: 'Install psycopg2 for Django < 3.1'
# Django < 3.1 is incompatible with psycopg2 2.9
# See https://github.com/psycopg/psycopg2/issues/1293
if: "matrix.django-version == '2.2.0' || matrix.django-version == '3.0.0'"
run: |
pip install 'psycopg2<2.9'
- name: 'Install psycopg2'
if: "matrix.django-version != '2.2.0' && matrix.django-version != '3.0.0'"
run: |
pip install psycopg2
- name: Install Django Release
run: |
pip install django~=${{ matrix.django-version }}
if: matrix.django-version != 'main'
- name: Install Django Main
continue-on-error: ${{ matrix.django-version == 'main' }}
- name: Install gettext
run: |
pip install 'https://github.com/django/django/archive/main.tar.gz'
if: matrix.django-version == 'main'
- name: Run Tests
continue-on-error: ${{ matrix.django-version == 'main' }}
env:
TESTDB: postgres
sudo apt-get -y install gettext
- name: Compile Translations
run: |
export PYTHONWARNINGS=always
coverage run --source='wafer' manage.py test && coverage report --skip-covered
cd wafer
python ../manage.py compilemessages
sqlite:
selenium:

runs-on: ubuntu-latest

name: SQLite - Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }} (Allowed Failures - ${{ matrix.django-version == 'main'}} )
name: Selenium - Browser ${{ matrix.browser }}
strategy:
max-parallel: 4
max-parallel: 2
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10','3.11']
django-version: ['3.2.0', '4.0.0', '4.1.0', '4.2.0', 'main']
exclude:
- django-version: '4.0.0'
python-version: '3.7'
- django-version: '4.1.0'
python-version: '3.7'
- django-version: '4.2.0'
python-version: '3.7'
- django-version: '4.2.0'
python-version: '3.8'
- django-version: 'main'
python-version: '3.7'
- django-version: 'main'
python-version: '3.8'
- django-version: 'main'
python-version: '3.9'
- django-version: '3.2.0'
python-version: '3.11'
- django-version: '4.0.0'
python-version: '3.11'
browser: ['chrome', 'firefox']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Install Dependencies
continue-on-error: ${{ matrix.django-version == 'main' }}
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt
- name: Install Django Release
pip install selenium
- name: Install node
uses: actions/setup-node@v4
- name: Install javascript dependencies
run: |
pip install django~=${{ matrix.django-version }}
if: matrix.django-version != 'main'
- name: Install Django Main
continue-on-error: ${{ matrix.django-version == 'main' }}
npm install
- name: Setup Chrome
uses: browser-actions/setup-chrome@v1
if: matrix.browser == 'chrome'
- name: Setup firefox
run: |
pip install 'https://github.com/django/django/archive/main.tar.gz'
if: matrix.django-version == 'main'
wget -O firefox.tar.bz2 'https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US'
tar xaf firefox.tar.bz2
export PATH=$PATH:${PWD}/firefox
if: matrix.browser == 'firefox'
- name: Run Tests
continue-on-error: ${{ matrix.django-version == 'main' }}
run: |
export PYTHONWARNINGS=always
coverage run --source='wafer' manage.py test && coverage report --skip-covered
translations:
runs-on: ubuntu-latest
name: Compile Translations
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt
- name: Install gettext
run: |
sudo apt-get -y install gettext
- name: Compile Translations
run: |
cd wafer
python ../manage.py compilemessages
python manage.py test --tag ${{ matrix.browser }}
91 changes: 91 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Run tests against postgres and sqlite

on:
workflow_call:
inputs:
python-version:
required: true
type: string
django-version:
required: true
type: string

jobs:
run-postgres-tests:
runs-on: ubuntu-latest

services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432

name: Postgres - Python ${{ inputs.python-version }}, Django ${{ inputs.django-version }} (Allowed Failures - ${{ inputs.django-version == 'main' }} )
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Install Dependencies
continue-on-error: ${{ inputs.django-version == 'main' }}
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt
- name: 'Install psycopg2'
run: |
pip install psycopg2
- name: Install Django Release
run: |
pip install django~=${{ inputs.django-version }}
if: inputs.django-version != 'main'
- name: Install Django Main
continue-on-error: ${{ inputs.django-version == 'main' }}
run: |
pip install 'https://github.com/django/django/archive/main.tar.gz'
if: inputs.django-version == 'main'
- name: Run Tests
continue-on-error: ${{ inputs.django-version == 'main' }}
env:
TESTDB: postgres
run: |
export PYTHONWARNINGS=always
coverage run --source='wafer' manage.py test --exclude-tag selenium && coverage report --skip-covered
run-sqlite-tests:
runs-on: ubuntu-latest
name: SQLite - Python ${{ inputs.python-version }}, Django ${{ inputs.django-version }} (Allowed Failures - ${{ inputs.django-version == 'main'}} )
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Install Dependencies
continue-on-error: ${{ inputs.django-version == 'main' }}
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt
- name: Install Django Release
run: |
pip install django~=${{ inputs.django-version }}
if: inputs.django-version != 'main'
- name: Install Django Main
continue-on-error: ${{ inputs.django-version == 'main' }}
run: |
pip install 'https://github.com/django/django/archive/main.tar.gz'
if: inputs.django-version == 'main'
- name: Run Tests
continue-on-error: ${{ inputs.django-version == 'main' }}
run: |
export PYTHONWARNINGS=always
coverage run --source='wafer' manage.py test --exclude-tag selenium && coverage report --skip-covered
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ nosetests.xml
/wafer.db
/media/
/wafer/static/vendor/

# Selenium log files
geckodriver.log
16 changes: 16 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

build:
os: ubuntu-22.04
tools:
python: "3.12"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

formats:
- pdf
23 changes: 18 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ wafer

|wafer-ci-badge| |wafer-docs-badge| |wafer-weblate-badge|

.. |wafer-ci-badge| image:: https://travis-ci.org/CTPUG/wafer.png?branch=master
:alt: Travis CI build status
.. |wafer-ci-badge| image:: https://github.com/CTPUG/wafer/actions/workflows/django.yml/badge.svg
:alt: Github actions CI build status
:scale: 100%
:target: https://travis-ci.org/CTPUG/wafer
:target: https://github.com/CTPUG/wafer/actions/

.. |wafer-docs-badge| image:: https://readthedocs.org/projects/wafer/badge/?version=latest
:alt: Wafer documentation
Expand Down Expand Up @@ -35,7 +35,7 @@ Available on `readthedocs.org`_.
Supported Django versions
=========================

Wafer supports Django 3.2 and Django 4.0 - 4.2.
Wafer supports Django 3.2, Django 4.0 - 4.2 and Django 5.0 .

Installation
============
Expand Down Expand Up @@ -76,7 +76,7 @@ Installation
7. Wafer uses the Django caching infrastructure in several places, so
the cache table needs to be created using ``manage.py createcachetable``.

8. Create the default 'Page Editors' and 'Talk Mentors' groups using
8. Create the default 'Page Editors', 'Talk Mentors' and other useful groups using
``manage.py wafer_add_default_groups``.

9. Log in and configure the Site:
Expand Down Expand Up @@ -118,3 +118,16 @@ Translation
Translations for wafer are managed at `weblate.org`_

.. _weblate.org: https://hosted.weblate.org/projects/wafer/


Selenium tests
==============

wafer includes a small set of selenium tests to test various bits of javascript
used in the site (mostly in the schedule editor).

To run the tests, you will need to install selenium - ``pip install selenium``
and also run ``npm install`` to install the required javascript dependencies.

The tests can be run using the ``selenium`` tag, or using the individual browser
tags (currently ``firefox`` and ``chrome``).
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
# built documents.
#
# The short X.Y version.
version = '0.15'
version = '0.16'
# The full version, including alpha/beta/rc tags.
release = '0.15.3a'
release = '0.16.2a'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
Loading

0 comments on commit 6c46f42

Please sign in to comment.