Skip to content

Merge pull request #1140 from tkdchen/snyk-check #593

Merge pull request #1140 from tkdchen/snyk-check

Merge pull request #1140 from tkdchen/snyk-check #593

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-latest
strategy:
max-parallel: 7
matrix:
python-version: [3.9, '3.10', '3.11']
django-version: [django320]
db: [sqlite]
include:
- python-version: '3.11'
django-version: django320
db: mysql
- python-version: '3.11'
django-version: django320
db: mariadb
- python-version: '3.11'
django-version: django320
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@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox "tox-docker>=2.0.0" 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