Draft Upgrade to support Django 3.2+ #14
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python: ["3.9", "3.10", "3.11", "3.12"] | |
| django: ["3.2", "4.2", "5.2"] | |
| db: ["sqlite3", "mysql", "postgres"] | |
| exclude: | |
| - python: "3.9" | |
| django: "5.2" | |
| db: "sqlite3" | |
| - python: "3.9" | |
| django: "5.2" | |
| db: "mysql" | |
| - python: "3.9" | |
| django: "5.2" | |
| db: "postgres" | |
| - python: "3.11" | |
| django: "3.2" | |
| db: "sqlite3" | |
| - python: "3.11" | |
| django: "3.2" | |
| db: "mysql" | |
| - python: "3.11" | |
| django: "3.2" | |
| db: "postgres" | |
| - python: "3.12" | |
| django: "3.2" | |
| db: "sqlite3" | |
| - python: "3.12" | |
| django: "3.2" | |
| db: "mysql" | |
| - python: "3.12" | |
| django: "3.2" | |
| db: "postgres" | |
| services: | |
| mysql: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_ALLOW_EMPTY_PASSWORD: "yes" | |
| MYSQL_DATABASE: daguerre_test | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd="mysqladmin ping -h localhost" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| postgres: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_DB: daguerre_test | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: "" | |
| POSTGRES_HOST_AUTH_METHOD: trust | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd="pg_isready -U postgres" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| env: | |
| DB: ${{ matrix.db }} | |
| DJANGO: ${{ matrix.django }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| cache: pip | |
| - name: Install client tools | |
| if: matrix.db != 'sqlite3' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y mysql-client postgresql-client | |
| - name: Install dependencies | |
| run: | | |
| echo "Django version: ${{ matrix.django }}" | |
| pip install . | |
| pip install -r test_project/requirements-${{ matrix.django }}.txt | |
| pip install flake8 | |
| if [ "${{ matrix.db }}" = "mysql" ]; then pip install mysqlclient==1.4.6; fi | |
| if [ "${{ matrix.db }}" = "postgres" ]; then pip install psycopg2-binary==2.8.4; fi | |
| - name: Lint | |
| run: flake8 --ignore=E501,E731,W504 daguerre | |
| - name: Prepare databases | |
| if: matrix.db != 'sqlite3' | |
| run: | | |
| if [ "${{ matrix.db }}" = "mysql" ]; then | |
| until mysqladmin ping -h 127.0.0.1 --silent; do sleep 2; done | |
| mysql -h 127.0.0.1 -e 'CREATE DATABASE IF NOT EXISTS daguerre_test;' | |
| fi | |
| if [ "${{ matrix.db }}" = "postgres" ]; then | |
| until pg_isready -h 127.0.0.1 -U postgres; do sleep 2; done | |
| psql -h 127.0.0.1 -U postgres -c 'drop database if exists daguerre_test;' | |
| psql -h 127.0.0.1 -U postgres -c 'create database daguerre_test;' | |
| fi | |
| - name: Run tests | |
| run: | | |
| cd test_project | |
| ./manage.py test --verbosity=2 daguerre |