-
Notifications
You must be signed in to change notification settings - Fork 2
130 lines (109 loc) · 4.47 KB
/
Copy pathdocker-reusable-workflow.yml
File metadata and controls
130 lines (109 loc) · 4.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: docker-reusable-workflow
on:
workflow_call:
inputs:
fastcdr_branch:
description: 'Branch or tag of Fast CDR repository (https://github.com/eProsima/Fast-CDR)'
required: true
default: 'master'
type: string
fastdds_branch:
description: 'Branch or tag of Fast DDS repository (https://github.com/eProsima/Fast-DDS)'
required: true
default: 'master'
type: string
devutils_branch:
description: 'Branch or tag of eProsima/dev-utils repository (https://github.com/eProsima/dev-utils)'
required: true
default: 'main'
type: string
ddspipe_branch:
description: 'Branch or tag of DDS Pipe repository (https://github.com/eProsima/DDS-Pipe)'
required: true
default: 'main'
type: string
ddsenabler_branch:
description: 'Branch or tag of DDS Enabler repository (https://github.com/eProsima/FIWARE-DDS-Enabler)'
required: true
default: 'main'
type: string
dependencies_artifact_postfix:
description: 'Postfix name to add to artifact name to download dependencies. This is use to download a specific artifact version from eProsima-CI.'
required: true
default: '_nightly'
type: string
ref:
description: >
The branch or tag name to checkout.
required: true
type: string
default: 'main'
env:
code_packages_names: 'ddsenabler_test'
docs_packages_names: ''
jobs:
docker-test:
runs-on: ubuntu-22.04
env:
DDSENABLER_COMPOSE_TEST_DOCKER_IMAGE: "ddsenabler:ci"
DDSENABLER_COMPOSE_TEST_ROS2_DOCKER_IMAGE: "eprosima/vulcanexus:jazzy-desktop"
steps:
- name: Sync repository
uses: eProsima/eProsima-CI/external/checkout@v0
with:
path: src
ref: ${{ inputs.ref }}
# Build DDS Enabler Docker image
- name: Build DDS Enabler Docker image
run: |
cd ./src/.github/docker/ddsenabler
docker build \
--no-cache \
--build-arg fastcdr_branch=${{ inputs.fastcdr_branch }} \
--build-arg fastdds_branch=${{ inputs.fastdds_branch }} \
--build-arg devutils_branch=${{ inputs.devutils_branch }} \
--build-arg ddspipe_branch=${{ inputs.ddspipe_branch }} \
--build-arg ddsenabler_branch=${{ inputs.ddsenabler_branch }} \
-t ${{ env.DDSENABLER_COMPOSE_TEST_DOCKER_IMAGE }} \
-f Dockerfile .
# Check DDS Enabler Docker images exist
- name: Check if DDS Enabler Docker images exist
run: |
[ -n "$(docker images -q ${{ env.DDSENABLER_COMPOSE_TEST_DOCKER_IMAGE }})" ] || echo "DDS Enabler Docker image does not exist"
# Pull ROS 2 Docker image
- name: Pull ROS 2 Docker image
run: |
docker image pull \
${{ env.DDSENABLER_COMPOSE_TEST_ROS2_DOCKER_IMAGE }}
# Check ROS 2 Docker images exist
- name: Check if ROS 2 Docker images exist
run: |
[ -n "$(docker images -q ${{ env.DDSENABLER_COMPOSE_TEST_ROS2_DOCKER_IMAGE }})" ] || echo "ROS 2 Docker image does not exist"
- name: Download dependencies and install requirements
uses: ./src/.github/actions/project_dependencies
with:
os: ubuntu-22.04
cmake_build_type: "Release"
dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix }}
secret_token: ${{ secrets.GITHUB_TOKEN }}
- name: Compile docker tests
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
with:
workspace: ${{ github.workspace }}
colcon_build_args: --packages-up-to ddsenabler_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
# Run ddsenabler_test compose tests
- name: Run tests
run: |
export DDSENABLER_COMPOSE_TEST_DOCKER_IMAGE=${{ env.DDSENABLER_COMPOSE_TEST_DOCKER_IMAGE }}
export DDSENABLER_COMPOSE_TEST_ROS2_DOCKER_IMAGE=${{ env.DDSENABLER_COMPOSE_TEST_ROS2_DOCKER_IMAGE }}
source install/setup.bash
colcon test \
--packages-select ddsenabler_test \
--event-handlers console_direct+ \
--return-code-on-test-failure \
--ctest-args \
--label-exclude xfail \
--timeout 120