From 2cc2d9c03aca21dae0d27d3eb33f438860a02fff 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 20:23:26 +0200 Subject: [PATCH 1/2] :gear: config(ci): Split docker compose build-and-test workflow. --- .github/workflows/ci:build:compose.yml | 46 ++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci:build:compose.yml b/.github/workflows/ci:build:compose.yml index ca887432b..58a19fd66 100644 --- a/.github/workflows/ci:build:compose.yml +++ b/.github/workflows/ci:build:compose.yml @@ -22,7 +22,7 @@ jobs: runs-on: ${{ matrix.platform }} - timeout-minutes: 18 + timeout-minutes: 15 steps: - name: Checkout 🛎️ @@ -40,12 +40,52 @@ jobs: - name: Bake 🧑‍🍳 uses: docker/bake-action@v4 with: - load: true files: | compose.yaml 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.tags=patients-patient-web + + - 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) + + needs: + - build + + strategy: + matrix: + platform: + - ubuntu-latest + + runs-on: ${{ matrix.platform }} + + timeout-minutes: 3 + + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v4 + + - name: Download image + uses: actions/download-artifact@v4 + with: + name: images-patient-web + path: /tmp/images + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Load image + run: | + docker image load --input /tmp/images/patient-web.tar - name: Start run: | From a4420a3756b3b574702f2a1bf205e79c1fe4d09d 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 20:23:31 +0200 Subject: [PATCH 2/2] :gear: config(ci): Force `docker compose up` to skip build in test job. --- .github/workflows/ci:build:compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci:build:compose.yml b/.github/workflows/ci:build:compose.yml index 58a19fd66..24f28e222 100644 --- a/.github/workflows/ci:build:compose.yml +++ b/.github/workflows/ci:build:compose.yml @@ -89,7 +89,7 @@ jobs: - name: Start run: | - docker compose up --detach + docker compose up --no-build --detach - name: Wait for database container to be healthy run: |