Skip to content

reduced num of py/django combos and kept only postgres in ci #278

reduced num of py/django combos and kept only postgres in ci

reduced num of py/django combos and kept only postgres in ci #278

Workflow file for this run

name: CI Pipeline
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
prefetch-images:
runs-on: [ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Restore Docker image cache
id: cache
uses: actions/cache@v3
with:
path: /tmp/docker-images
key: ${{ runner.os }}-docker-images
- name: Pull and Save Images
if: steps.cache.outputs.cache-hit != 'true'
run: |
docker compose pull
imgs=$(docker compose config | awk '/image: /{print $2}')
mkdir -p /tmp/docker-images
docker save $imgs -o /tmp/docker-images/images.tar
test:
needs: prefetch-images
runs-on: [ubuntu-latest]
strategy:
matrix:
include:
- python-version: "3.8"
django-version: 32
- python-version: "3.9"
django-version: 32
- python-version: "3.10"
django-version: 42
- python-version: "3.11"
django-version: 42
- python-version: "3.12"
django-version: 51
db: [postgres]
action: [rabbitmq, kafka, redis, aws, gcp]
env:
DJANGO_SETTINGS_MODULE: tests.settings
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Restore Docker image cache
uses: actions/cache@v3
with:
path: /tmp/docker-images
key: ${{ runner.os }}-docker-images
- name: Load Docker images
run: docker load -i /tmp/docker-images/images.tar || true
- name: Start Docker Containers
run: docker compose up -d --wait
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run tests with Tox
run: |
tox -e py${{ matrix.python-version }}-django${{ matrix.django-version }}-${{ matrix.db }}-${{ matrix.action }}
type-check:
runs-on: [ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: make ci-install-deps-global
- name: Run type checks
run: |
make type-check
lint:
runs-on: [ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: make ci-install-deps-global
- name: Run linter
run: |
make lint