refactor: add pyproject.toml #894
Workflow file for this run
This file contains 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: pytest | |
on: | |
push: | |
branches: | |
- master | |
- 'releases/**' | |
tags: | |
- '*.*.*' | |
pull_request: | |
# 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: | |
db-backend: [mysql, postgres, sqlite3] | |
python-version: ['3.6', '3.7', '3.11'] | |
fail-fast: false # TODO: demonstrate 3.6 is failing, but 3.7-3.11 are passing | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_DB: rdmo | |
POSTGRES_PASSWORD: postgres_password | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Dependencies | |
run: | | |
sudo apt update && sudo apt install -y pandoc texlive-xetex texlive-latex-extra texlive-fonts-recommended lmodern librsvg2-bin | |
sudo apt install -y libpq-dev postgresql postgresql-client | |
python -m pip install --upgrade pip | |
- name: Install RDMO | |
run: | | |
pip install -e .[mysql,postgres,ci] | |
- 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 | |
sudo systemctl start mysql.service | |
- name: Run Tests | |
run: | | |
pytest --cov=rdmo | |
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 }} |