Skip to content

fix pip install in test matrix #114

fix pip install in test matrix

fix pip install in test matrix #114

Workflow file for this run

name: Test django-filer (finder branch)
on:
push:
branches:
- finder
paths-ignore:
- '**.md'
- '**.rst'
- '/docs/**'
pull_request:
branches:
- develop
paths-ignore:
- '**.md'
- '**.rst'
- '/docs/**'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
django-version: ["5.2", "6.0"]
node-version: ["22.x"]
with_cte: ["0", "1"]
use_postgres: ["0", "1"]
use_s3: ["0", "1"]
exclude:
- python-version: "3.11"
django-version: "6.0"
use_s3: "1"
- python-version: "3.12"
django-version: "5.2"
use_s3: "1"
- django-version: "5.2"
with_cte: "0"
use_postgres: "1"
use_s3: "1"
- django-version: "6.0"
with_cte: "0"
use_postgres: "0"
name: "py${{ matrix.python-version }} django-${{ matrix.django-version }} with ${{ matrix.use_postgres == '1' && 'PostgreSQL' || 'SQLite' }}${{ matrix.with_cte == '1' && ' and CTE' || '' }}"
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies from PyPI and npm
run: |
sudo apt-get update
sudo apt-get install -y libcairo2-dev pkg-config
npm install --include=dev
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel
python -m pip install "Django~=${{ matrix.django-version }}"
python -m pip install django-entangled ffmpeg-python pillow reportlab svglib pycairo
python -m pip install beautifulsoup4 coverage Faker lxml pytest pytest-django pytest-cov
- name: Install Django-CTE
if: ${{ matrix.with_cte == '1' }}
run: |
python -m pip install django-cte
- name: Start Postgres container and install Postgres driver
if: ${{ matrix.use_postgres == '1' }}
run: |
python -m pip install psycopg2-binary
docker run --name test-postgres -e POSTGRES_DB=test_finder \
-e POSTGRES_USER=finder -e POSTGRES_PASSWORD=finder -p 5432:5432 -d postgres:16
# wait until pg_isready succeeds (up to ~30s)
for i in $(seq 1 30); do
docker exec test-postgres pg_isready -U finder && break || sleep 1
done
- name: Start MinIO container
if: ${{ matrix.use_s3 == '1' }}
run: |
python -m pip install django-storages[s3]
docker run --name test-minio -p 9000:9000 -p 9001:9001 -d \
-e MINIO_ROOT_USER=minioadmin -e MINIO_ROOT_PASSWORD=minioadmin \
minio/minio:latest server /data --console-address ":9001"
# wait until MinIO is ready (up to ~30s)
for i in $(seq 1 30); do
docker exec test-minio mc alias set local http://localhost:9000 minioadmin minioadmin && break || sleep 1
done
- name: Test with pytest
run: |
export USE_POSTGRES="${{ matrix.use_postgres }}"
export USE_S3="${{ matrix.use_s3 }}"
python -m pytest -v unittests