From 0cd3a08085972fbe8f45cbb2c14c73449d86e60a Mon Sep 17 00:00:00 2001 From: Nick Le Large Date: Wed, 6 Nov 2024 08:55:31 +0100 Subject: [PATCH] Switch to docker-compose for GitHub actions --- .github/workflows/run-unit-tests.yaml | 11 ++--------- demo/docker-compose.yaml | 9 +++++++++ docker-compose.yaml | 10 ++++++++++ 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/run-unit-tests.yaml b/.github/workflows/run-unit-tests.yaml index 65ca9a16..7a3de6c6 100644 --- a/.github/workflows/run-unit-tests.yaml +++ b/.github/workflows/run-unit-tests.yaml @@ -15,16 +15,9 @@ jobs: - name: Build Docker image for library unit tests run: | - docker build --target unittest --tag arbitration_graphs_test . - - - name: Run library unit tests in Docker container - run: | - docker run --rm arbitration_graphs_test + docker compose run --rm --build arbitration_graphs_test - name: Build Docker image for demo unit tests run: | - docker build --file demo/Dockerfile --target unittest --tag arbitration_graphs_demo_test demo + docker compose -f demo/docker-compose.yaml run --rm --build demo_test - - name: Run unit tests in Docker container - run: | - docker run --rm arbitration_graphs_demo_test diff --git a/demo/docker-compose.yaml b/demo/docker-compose.yaml index fea43e6e..63e4ebb4 100644 --- a/demo/docker-compose.yaml +++ b/demo/docker-compose.yaml @@ -1,4 +1,13 @@ services: + demo_test: + image: ghcr.io/kit-mrt/arbitration_graphs_pacman_demo_test:$VERSION + build: + context: . + args: + - VERSION=$VERSION + target: unit_test + env_file: .env + tutorial: image: ghcr.io/kit-mrt/arbitration_graphs_pacman_tutorial:$VERSION build: diff --git a/docker-compose.yaml b/docker-compose.yaml index 197e3414..ad5f3f57 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,6 +3,7 @@ services: image: ghcr.io/kit-mrt/arbitration_graphs:$VERSION build: . env_file: .env + arbitration_graphs_devel: build: context: . @@ -12,3 +13,12 @@ services: image: arbitration_graphs_devel:$VERSION volumes: - .:/home/blinky/arbitration_graphs + + arbitration_graphs_test: + build: + context: . + target: unit_test + extends: + service: arbitration_graphs + image: arbitration_graphs_test:$VERSION +