Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split docker compose build-and-test workflow #892

Merged
merged 2 commits into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 44 additions & 4 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,56 @@ 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: |
docker compose up --detach
docker compose up --no-build --detach

- name: Wait for database container to be healthy
run: |
Expand Down
Loading