Skip to content

Commit

Permalink
⚙️ config(ci): Split docker compose build-and-test workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Apr 17, 2024
1 parent 77e7767 commit 2083721
Showing 1 changed file with 47 additions and 3 deletions.
50 changes: 47 additions & 3 deletions .github/workflows/ci:build:compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

runs-on: ${{ matrix.platform }}

timeout-minutes: 18
timeout-minutes: 15

steps:
- name: Checkout 🛎️
Expand All @@ -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: |
Expand Down

0 comments on commit 2083721

Please sign in to comment.