Skip to content

Merge pull request #1197 from tkdchen/add-py312-to-testenv #155

Merge pull request #1197 from tkdchen/add-py312-to-testenv

Merge pull request #1197 from tkdchen/add-py312-to-testenv #155

Workflow file for this run

name: Unit Tests
on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
jobs:
unittests:
name: "py${{ matrix.python-version }}-${{ matrix.django-version }}-${{ matrix.db }}"
runs-on: ubuntu-24.04
services:
mariadb:
image: mariadb:10.4.14
ports:
- 33061:3306
env:
MYSQL_DATABASE: nitrate
MYSQL_ROOT_PASSWORD: pass
options: >-
--name=testdb-mariadb
--health-cmd="mysqladmin ping -uroot -ppass"
--health-interval=5s
--health-timeout=2s
--health-retries=3
postgres:
image: postgres:12.4
ports:
- 54321:5432
env:
POSTGRES_PASSWORD: pass
options: >-
--name=testdb-pgsql
--health-cmd="echo pass | psql -U postgres -W --command 'SELECT 1'"
--health-interval=5s
--health-timeout=2s
--health-retries=3
mysql:
image: mysql:8.0.22
ports:
- 33062:3306
env:
MYSQL_DATABASE: nitrate
MYSQL_ROOT_PASSWORD: pass
options: >-
--name=testdb-mysql
--health-cmd="mysqladmin ping -uroot -ppass"
--health-interval=5s
--health-timeout=2s
--health-retries=3
strategy:
max-parallel: 7
matrix:
python-version: [3.9, '3.10', '3.11', '3.12']
django-version: [django420]
db: [sqlite]
include:
- python-version: '3.12'
django-version: django420
db: mysql
- python-version: '3.12'
django-version: django420
db: mariadb
- python-version: '3.12'
django-version: django420
db: postgres
steps:
- name: Install packages used to setup testenv
run: |
sudo apt update
sudo apt-get install gcc python3-dev libkrb5-dev libmariadb-dev libcrypt-dev
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox coveralls
- run: |
echo "tox_pyver=${pyver}" | sed "s/\.//" >> $GITHUB_ENV
env:
pyver: ${{ matrix.python-version }}
- name: Tox
run: |
tox -e py$tox_pyver-${{ matrix.django-version }}-${{ matrix.db }}
- name: Parallel coverage report
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: testenv-py${{ matrix.python-version }}-${{ matrix.django-version }}-${{ matrix.db }}
parallel: true
coveralls:
name: Finish Coveralls
needs: unittests
runs-on: ubuntu-latest
steps:
- name: Finish coverage report
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true