Add pyproject.toml to dev-setup-ractoring #902
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: | |
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: | |
db-backend: [sqlite3] | |
python-version: ['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 | |
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 rdmo/core/tests/test_project_status.py --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 }} |