diff --git a/.github/workflows/run-unit-tests.yaml b/.github/workflows/run-unit-tests.yaml index 7e3dc097..7932a8bd 100644 --- a/.github/workflows/run-unit-tests.yaml +++ b/.github/workflows/run-unit-tests.yaml @@ -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 }} diff --git a/demo/docker-compose.yaml b/demo/docker-compose.yaml index 63e4ebb4..fea43e6e 100644 --- a/demo/docker-compose.yaml +++ b/demo/docker-compose.yaml @@ -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: diff --git a/docker-compose.yaml b/docker-compose.yaml index ad5f3f57..ffccf7fd 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -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 -