Skip to content

Add pyproject.toml to dev-setup-ractoring #904

Add pyproject.toml to dev-setup-ractoring

Add pyproject.toml to dev-setup-ractoring #904

Workflow file for this run

name: pytest
on:
push:
branches:
- master
- 'releases/**'
tags:
- '*.*.*'
pull_request:
env:
PYTHONDONTWRITEBYTECODE: 1
# https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.6', '3.7', '3.11']
db-backend: [mysql, postgres, sqlite3]
fail-fast: false # TODO: demonstrate 3.6 is failing, but 3.7-3.11 are passing
name: "Build (Python: ${{ matrix.python-version }}, DB: ${{ matrix.db-backend }})"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install Dependencies
run: |
sudo apt update
sudo apt install --yes pandoc texlive-xetex texlive-latex-extra texlive-fonts-recommended lmodern librsvg2-bin gettext
python -m pip install --upgrade pip
pandoc --version
gettext --version
- name: Install RDMO
run: |
pip install -e .[ci]
- name: Setup mysql
run: |
pip install -e .[mysql]
sudo systemctl start mysql.service
if: matrix.db-backend == 'mysql'
- name: Setup postgres
run: |
pip install -e .[postgres]
sudo systemctl start postgresql.service
pg_isready
sudo -u postgres psql --command="CREATE USER postgres_user PASSWORD 'postgres_password' CREATEDB"
if: matrix.db-backend == 'postgres'
- name: Prepare Env
run: |
cp testing/config/settings/${{ matrix.db-backend }}.py testing/config/settings/local.py
cp -r testing/media testing/media_root
mkdir testing/log
- name: Run Tests
run: |
pytest --cov
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: '${{ matrix.db-backend }}: ${{ matrix.python-version }}'
COVERALLS_PARALLEL: true
coveralls:
name: Indicate completion to coveralls
needs: build
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Run Coveralls finish
run: |
pip install coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}