reduced num of py/django combos and kept only postgres in ci #279
Workflow file for this run
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 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: | |
py_dj: [py38-django32, py39-django32, py310-django42, py311-django42, py312-django51] | |
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 ${{ matrix.py_dj }}-${{ 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 |