diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 000000000..4bab5d232 --- /dev/null +++ b/.github/workflows/checks.yml @@ -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 diff --git a/app/config.py b/app/config.py index f5f7f9325..507134e07 100644 --- a/app/config.py +++ b/app/config.py @@ -471,8 +471,8 @@ class Test(Development): TRANSIENT_UPLOADED_LETTERS = 'test-transient-uploaded-letters' LETTER_SANITISE_BUCKET_NAME = 'test-letters-sanitise' - # this is overriden in jenkins and on cloudfoundry - SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATABASE_URI', 'postgresql://postgres:chummy@db:5432/notification_api') + # this is overriden in CI + SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATABASE_TEST_URI', 'postgresql://postgres:chummy@db:5432/test_notification_api') CELERY = { **Config.CELERY,