Repo consistency #661
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: Run tests | |
on: [pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
postgres_version: ['14','16'] | |
services: | |
postgres: | |
image: postgres:${{ matrix.postgres_version }} | |
env: | |
POSTGRES_DB: ndoh_hub | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- 5432:5432 | |
redis: | |
image: redis:6.0 | |
ports: | |
- 6379:6379 | |
env: | |
HUB_DATABASE: postgres://postgres:postgres@localhost:5432/ndoh_hub | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install gettext | |
run: sudo apt-get install gettext | |
- uses: actions/setup-python@v5.0.0 | |
with: | |
python-version: 3.9 | |
- uses: abatilo/actions-poetry@v2.0.0 | |
with: | |
poetry-version: "1.8.3" | |
- name: Install dependencies | |
id: install-deps | |
run: | | |
poetry install | |
- name: Check formatting | |
# Lints/tests should always run, even if other lints/tests have failed. | |
if: success() || failure() && steps.install-deps.outcome == 'success' | |
run: | | |
poetry run ruff format --check | |
- name: Lint | |
if: success() || failure() && steps.install-deps.outcome == 'success' | |
run: | | |
poetry run ruff check | |
- name: Run tests | |
if: success() || failure() && steps.install-deps.outcome == 'success' | |
run: | | |
poetry run pytest -vv | |