Skip to content

[pre-commit.ci] pre-commit autoupdate #1646

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #1646

Workflow file for this run

name: django model subscription test.
on:
push:
branches:
- main
pull_request:
branches:
- main
- '**'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, '3.10', 3.11]
exclude:
- platform: macos-latest
python-version: 3.11
- platform: windows-latest
python-version: 3.11
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_user_password
POSTGRES_DB: test
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: >-
--health-cmd pg_isready
--health-interval=10s
--health-timeout=5s
--health-retries=5
mysql:
image: bitnami/mysql:latest
env:
MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password
MYSQL_USER: test_user
MYSQL_PASSWORD: test_user_password
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: test_user_password
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- uses: actions/[email protected]
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/[email protected]
id: pip-cache
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip
- name: Install dependencies
run: |
pip install --upgrade pip setuptools
sudo apt-get install -y --no-install-recommends libpq-dev
- name: Test with tox
run: |
make tox
env:
# use postgres for the host here because we have specified a container for the job.
# If we were running the job on the VM this would be localhost
POSTGRES_HOST: postgres
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
PG_USER: test_user
PG_PASSWORD: test_user_password
PG_DB: test
MYSQL_DB: test
MYSQL_USER: test_user
MYSQL_PASSWORD: test_user_password
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
# - name: Upload coverage to Codecov
# uses: codecov/[email protected]
# with:
# fail_ci_if_error: true