From 0e68f822fdf3196a4d9886ca72c6e8fca35f4bf8 Mon Sep 17 00:00:00 2001 From: Sebastiaan Zeeff <33516116+SebastiaanZ@users.noreply.github.com> Date: Thu, 19 Nov 2020 09:33:42 +0100 Subject: Start database at the beginning of the workflow The CI was failing on occasion because postgres did not have time enough to start properly before we started running our makemigrations check. I've moved the docker-compose step to earlier in the workflow to give it some time to warm up. --- .github/workflows/lint-test.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index 80305322..668c888d 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -40,6 +40,11 @@ jobs: with: python-version: '3.8' + # Start the database early to give it a chance to get ready before + # we start running tests. + - name: Run database using docker-compose + run: docker-compose run -d -p 7777:5432 --name pydis_web postgres + # This step caches our Python dependencies. To make sure we # only restore a cache when the dependencies, the python version, # the runner operating system, and the dependency location haven't @@ -92,9 +97,6 @@ jobs: --format='::error file=%(path)s,line=%(row)d,col=%(col)d::\ [flake8] %(code)s: %(text)s'" - - name: Run database using docker-compose - run: docker-compose run -d -p 7777:5432 --name pydis_web postgres - - name: Migrations and run tests with coverage.py run: | python manage.py makemigrations --check -- cgit v1.2.3