Skip to content

Commit

Permalink
Switch back to pure docker builds to keep docker compose files clean
Browse files Browse the repository at this point in the history
  • Loading branch information
ll-nick committed Nov 7, 2024
1 parent 490580a commit fa24883
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 22 deletions.
34 changes: 29 additions & 5 deletions .github/workflows/run-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,38 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
- name: Check out the repository
uses: actions/checkout@v4

- name: Build Docker image for library unit tests
- name: Read version from file
run: |
docker compose run --rm --build arbitration_graphs_test
cat version >> $GITHUB_ENV
- name: Build Docker image for demo unit tests
- name: Build core library unit test Docker image
uses: docker/build-push-action@v6
with:
push: false
tags: |
ghcr.io/kit-mrt/arbitration_graphs_tests:${{ env.VERSION }}
target: unit_test

- name: Run library unit tests
run: |
docker compose -f demo/docker-compose.yaml run --rm --build demo_test
docker run --rm ghcr.io/kit-mrt/arbitration_graphs_tests:${{ env.VERSION }}
- name: Build Pacman demo unit test Docker image
uses: docker/build-push-action@v6
with:
build-args: |
VERSION=${{ env.VERSION }}
context: demo
file: demo/Dockerfile
push: false
tags: |
ghcr.io/kit-mrt/arbitration_graphs_pacman_demo_tests:latest
ghcr.io/kit-mrt/arbitration_graphs_pacman_demo_tests:${{ env.VERSION }}
target: unit_test

- name: Run demo unit tests
run: |
docker run --rm ghcr.io/kit-mrt/arbitration_graphs_pacman_demo_tests:${{ env.VERSION }}
9 changes: 0 additions & 9 deletions demo/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
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:
Expand Down
8 changes: 0 additions & 8 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,3 @@ services:
volumes:
- .:/home/blinky/arbitration_graphs

arbitration_graphs_test:
build:
context: .
target: unit_test
extends:
service: arbitration_graphs
image: arbitration_graphs_test:$VERSION

0 comments on commit fa24883

Please sign in to comment.