Allow a restricted incident priority for stable status #6315
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: Python Lint and Test | |
on: pull_request | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: dispatch | |
POSTGRES_DB: dispatch | |
ports: | |
- 5432:5432 | |
# needed because the postgres container does not provide a healthcheck | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v2 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11.2 | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install python dependencies | |
run: | | |
export DISPATCH_LIGHT_BUILD=1 | |
python -m pip install --upgrade pip | |
pip install -e ".[dev]" | |
- name: "Lint with black" | |
uses: psf/black@stable | |
- name: "Lint with ruff" | |
run: | | |
ruff check src tests | |
- name: Test with pytest | |
run: | | |
pip install pytest-cov | |
pytest --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html |