From d13be7511fbab472f8310421f4f19c061503d728 Mon Sep 17 00:00:00 2001 From: make-github-pseudonymous-again <5165674+make-github-pseudonymous-again@users.noreply.github.com> Date: Thu, 18 Apr 2024 07:57:10 +0200 Subject: [PATCH] :construction: progress: Try to figure out what image name is used. --- .github/workflows/ci:build:compose.yml | 47 +++++++++++++++++++++----- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci:build:compose.yml b/.github/workflows/ci:build:compose.yml index a8bd28b09..b1339b03e 100644 --- a/.github/workflows/ci:build:compose.yml +++ b/.github/workflows/ci:build:compose.yml @@ -45,14 +45,45 @@ jobs: set: | patient-web.cache-from=type=gha patient-web.cache-to=type=gha,mode=max - patient-web.output=type=docker,dest=/tmp/patient-web.tar + patient-web.output=type=image + + - name: List images + run: | + docker image ls -a + + - name: Start + run: | + docker compose up --no-build --detach + + - name: Wait for database container to be healthy + run: | + timeout 60 bash -c \ + 'until docker inspect --format "{{json .State.Health }}" "$(docker compose ps -q patient-db)" | jq -e ".Status == \"healthy\"" ; do sleep 1; done' + + - name: Wait for web port to be available + run: | + timeout 60 bash -c \ + 'until nc -z -v -w5 127.0.0.1 3000 ; do sleep 1; done' + + - name: Wait for web container to be healthy + run: | + timeout 60 bash -c \ + 'until docker inspect --format "{{json .State.Health }}" "$(docker compose ps -q patient-web)" | jq -e ".Status == \"healthy\"" ; do sleep 1; done' + + - name: Call healthcheck endpoint + run: | + timeout 60 bash -c \ + 'curl -f http://localhost:3000/api/healthcheck' + + - name: Run healthcheck script + run: | + timeout 60 bash -c \ + 'node scripts/healthcheck.cjs http://localhost:3000/api/healthcheck' + + - name: Stop + run: | + docker compose down - - name: Upload image - uses: actions/upload-artifact@v4 - with: - name: images-patient-web - path: /tmp/patient-web.tar - retention-days: 1 test: name: Continuous integration (build compose test) @@ -89,7 +120,7 @@ jobs: - name: Start run: | - docker compose up --detach + docker compose up --no-build --detach - name: Wait for database container to be healthy run: |