Add Docker tests #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test-docker-workflow | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
- humble | |
- iron | |
- jazzy | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
docker-tests: | |
runs-on: ubuntu-22.04 | |
env: | |
VULCANEXUS_COMPOSE_TEST_DOCKER_IMAGE: "vulcanexus:ci" | |
steps: | |
- name: Build Vulcanexus Docker image | |
run: | | |
cd ./src/.github/docker/vulcanexus | |
docker build \ | |
--no-cache \ | |
-t ${{ env.VULCANEXUS_COMPOSE_TEST_DOCKER_IMAGE }} \ | |
-f Dockerfile . | |
- name: Check if Docker images exist | |
run: | | |
[ -n "$(docker images -q ${{ env.VULCANEXUS_COMPOSE_TEST_DOCKER_IMAGE }})" ] || echo "Vulcanexus Docker image does not exist" | |
- name: Compile docker tests | |
run: | | |
colcon build \ | |
--packages-select vulcanexus_test \ | |
--cmake-args \ | |
-DBUILD_COMPOSE_TESTS=ON | |
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 | |
with: | |
workspace: ${{ github.workspace }} | |
colcon_build_args: --packages-up-to ddsrouter_test | |
cmake_args: -DBUILD_COMPOSE_TESTS=ON -DCMAKE_BUILD_TYPE=Release | |
workspace_dependencies: install | |
colcon_meta_file: src/.github/workflows/configurations/${{ runner.os }}/colcon.meta | |
- name: Run tests | |
run: | | |
export VULCANEXUS_COMPOSE_TEST_DOCKER_IMAGE=${{ env.VULCANEXUS_COMPOSE_TEST_DOCKER_IMAGE }} | |
source install/setup.bash | |
colcon test \ | |
--packages-select vulcanexus_test \ | |
--event-handlers console_direct+ \ | |
--return-code-on-test-failure \ | |
--ctest-args \ | |
--timeout 120 |