From 20837210a91b34881697d169ac324cad21f5b448 Mon Sep 17 00:00:00 2001 From: make-github-pseudonymous-again <5165674+make-github-pseudonymous-again@users.noreply.github.com> Date: Wed, 17 Apr 2024 21:03:34 +0200 Subject: [PATCH] :gear: config(ci): Split docker compose build-and-test workflow. --- .github/workflows/ci:build:compose.yml | 50 ++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci:build:compose.yml b/.github/workflows/ci:build:compose.yml index f6c6721c0..c927e1bb5 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,16 +40,60 @@ 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 + + - name: Upload image + uses: actions/upload-artifact@v4 + with: + name: images-patient-web + path: /tmp/patient-web.tar + + test: + name: Continuous integration (build compose test) + + needs: + - build + + strategy: + matrix: + platform: + - ubuntu-latest + + runs-on: ${{ matrix.platform }} + + timeout-minutes: 3 + + steps: + - uses: actions/checkout@v4 + with: + sparse-checkout: | + .env + compose.yaml + scripts/healthcheck.cjs + sparse-checkout-cone-mode: false + + - 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 load --input /tmp/images/patient-web.tar + docker image ls -a - name: Start run: | - docker compose up --detach + docker compose up --no-build --detach - name: Wait for database container to be healthy run: |