Skip to content

Commit

Permalink
test: build test images automatically using docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
KSmanis committed Oct 5, 2024
1 parent 65f27d2 commit 5f52a7e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,9 @@ jobs:
- name: Inspect image
run: |
docker image inspect ${{ steps.build.outputs.imageid }}
- name: Build test image
id: build-test
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6
with:
context: .
platforms: linux/${{ matrix.arch }}
target: distcc-${{ matrix.target }}-test
load: true
- name: Test distcc
env:
DOCKER_DEFAULT_PLATFORM: linux/${{ matrix.arch }}
IMAGE: ${{ steps.build.outputs.imageid }}
TEST_IMAGE: ${{ steps.build-test.outputs.imageid }}
run: |
docker compose --ansi always -f docker-compose.test.yml -p test up \
--exit-code-from distcc-${{ matrix.target }}-client \
Expand Down
12 changes: 8 additions & 4 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
services:
distcc-tcp-server:
image: ${IMAGE}
build:
target: distcc-tcp
healthcheck:
interval: 3s
start_period: 30s
Expand All @@ -10,12 +11,14 @@ services:
depends_on:
distcc-tcp-server:
condition: service_healthy
image: ${TEST_IMAGE}
build:
target: distcc-tcp-test
environment:
- DISTCC_HOSTS=distcc-tcp-server

distcc-ssh-server:
image: ${IMAGE}
build:
target: distcc-ssh
healthcheck:
interval: 3s
start_period: 30s
Expand All @@ -26,6 +29,7 @@ services:
depends_on:
distcc-ssh-server:
condition: service_healthy
image: ${TEST_IMAGE}
build:
target: distcc-ssh-test
environment:
- DISTCC_HOSTS=@distcc-ssh-server

0 comments on commit 5f52a7e

Please sign in to comment.