Skip to content

Various fixes found in front-end QA #355

Various fixes found in front-end QA

Various fixes found in front-end QA #355

Workflow file for this run

name: checks
on:
push:
branches: [ main, develop ]
pull_request: # run on all PRs
schedule: # run weekly
- cron: "0 12 * * 0"
# HACK: let's add fake colandr envvars so tests can run
# TODO (burton): figure out a better way of configuring the app!
env:
COLANDR_DB_USER: "colandr_app"
COLANDR_DB_PASSWORD: "password"
COLANDR_DB_NAME: "colandr"
COLANDR_DATABASE_URI: "postgresql://colandr_app:password@localhost:5432/colandr"
COLANDR_SECRET_KEY: "colandr_secret_key"
COLANDR_APP_DIR: "/tmp"
COLANDR_MAIL_USERNAME: "colandr_mail_username"
COLANDR_MAIL_PASSWORD: "colandr_mail_password"
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10",]
# TODO: also run on macos-latest pending docker/colima issue
os: [ubuntu-latest]
services:
# NOTE: these containers should match those in app's docker compose file
colandr_db:
image: "postgres:16"
env:
POSTGRES_USER: ${{ env.COLANDR_DB_USER }}
POSTGRES_PASSWORD: ${{ env.COLANDR_DB_PASSWORD }}
POSTGRES_DB: ${{ env.COLANDR_DB_NAME }}
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
colandr_broker:
image: "redis:7.0"
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "pyproject.toml"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install -e '.[dev]'
- name: Download language data
run: |
python -m textacy download lang_identifier --version 3.0
python -m spacy download en_core_web_md
python -m spacy download es_core_news_md
python -m spacy download fr_core_news_md
- name: Test with pytest
run: |
python -m pytest tests --verbose
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "pyproject.toml"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install -e '.[dev]'
- name: Check with ruff
run: |
python -m ruff check --output-format=github --exit-zero colandr
types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "pyproject.toml"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install -e '.[dev]'
- name: Check types with mypy
run: |
python -m mypy --install-types --non-interactive colandr