mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-21 16:01:15 -05:00
Run tests in CI
This commit is contained in:
40
.github/workflows/checks.yml
vendored
Normal file
40
.github/workflows/checks.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
name: Run checks
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres
|
||||||
|
env:
|
||||||
|
POSTGRES_DB: db
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: password
|
||||||
|
options: >-
|
||||||
|
--health-cmd pg_isready
|
||||||
|
--health-interval 10s
|
||||||
|
--health-timeout 5s
|
||||||
|
--health-retries 5
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Set up Python 3.9
|
||||||
|
uses: actions/setup-python@v3
|
||||||
|
with:
|
||||||
|
python-version: "3.9"
|
||||||
|
- name: Install dependencies
|
||||||
|
run: make bootstrap
|
||||||
|
# - name: Run style checks
|
||||||
|
# run: flake8 .
|
||||||
|
# - name: Check imports alphabetized
|
||||||
|
# run: isort --check-only ./app ./tests
|
||||||
|
- name: Run tests
|
||||||
|
run: pytest -n4 --maxfail=10
|
||||||
|
env:
|
||||||
|
SQLALCHEMY_DATABASE_TEST_URI: postgresql://postgres:password@db:5432/test_notification_api
|
||||||
@@ -471,8 +471,8 @@ class Test(Development):
|
|||||||
TRANSIENT_UPLOADED_LETTERS = 'test-transient-uploaded-letters'
|
TRANSIENT_UPLOADED_LETTERS = 'test-transient-uploaded-letters'
|
||||||
LETTER_SANITISE_BUCKET_NAME = 'test-letters-sanitise'
|
LETTER_SANITISE_BUCKET_NAME = 'test-letters-sanitise'
|
||||||
|
|
||||||
# this is overriden in jenkins and on cloudfoundry
|
# this is overriden in CI
|
||||||
SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATABASE_URI', 'postgresql://postgres:chummy@db:5432/notification_api')
|
SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATABASE_TEST_URI', 'postgresql://postgres:chummy@db:5432/test_notification_api')
|
||||||
|
|
||||||
CELERY = {
|
CELERY = {
|
||||||
**Config.CELERY,
|
**Config.CELERY,
|
||||||
|
|||||||
Reference in New Issue
Block a user