Skip to content

Commit 2b56301

Browse files
Split Mac CI build and testing phases (#6011) (#6082)
* Refs #23667: Split Mac CI in two * Refs #23667: Fix typo * Refs #23667: Solve issues with permissions --------- (cherry picked from commit ddbd302) Signed-off-by: cferreiragonz <[email protected]> Co-authored-by: Carlos Ferreira González <[email protected]>
1 parent 36e17ef commit 2b56301

File tree

2 files changed

+77
-17
lines changed

2 files changed

+77
-17
lines changed

.github/workflows/mac-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ jobs:
5555
ctest-args: ${{ inputs.ctest-args }}
5656
fastdds-branch: ${{ inputs.fastdds_branch || github.ref || '3.3.x' }}
5757
use-ccache: ${{ ((inputs.use-ccache == true) && true) || false }}
58+
run-tests: ${{ ((inputs.run-tests == true) && true) || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'no-test')) }}

.github/workflows/reusable-mac-ci.yml

Lines changed: 76 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_call:
55
inputs:
66
label:
7-
description: 'ID associated to the workflow'
7+
description: 'ID associated to the workflow. Must univocally identify artifacts.'
88
required: true
99
type: string
1010
colcon-args:
@@ -33,13 +33,18 @@ on:
3333
required: false
3434
type: boolean
3535
default: false
36+
run-tests:
37+
description: 'Run test suite of Fast DDS'
38+
required: false
39+
type: boolean
40+
default: true
3641

3742
defaults:
3843
run:
3944
shell: bash
4045

4146
jobs:
42-
reusable-mac-ci:
47+
fastdds_build:
4348
# As explained in https://github.com/actions/runner-images/tree/main?tab=readme-ov-file#available-images,
4449
# *-latest images are not always the latest available versions. The minimum version of the macOS image
4550
# with clang 15 is macos-13 (see
@@ -60,7 +65,8 @@ jobs:
6065
submodules: true
6166
ref: ${{ inputs.fastdds-branch }}
6267

63-
- uses: eProsima/eProsima-CI/external/setup-python@v0
68+
- name: Install Fix Python version
69+
uses: eProsima/eProsima-CI/external/setup-python@v0
6470
with:
6571
python-version: '3.11'
6672

@@ -91,18 +97,6 @@ jobs:
9197
with:
9298
api_token: ${{ secrets.GITHUB_TOKEN }}
9399

94-
- name: Set up hosts file for DNS testing
95-
run: |
96-
sudo echo "" | sudo tee -a /etc/hosts
97-
sudo echo "127.0.0.1 localhost.test" | sudo tee -a /etc/hosts
98-
sudo echo "::1 localhost.test" | sudo tee -a /etc/hosts
99-
sudo echo "154.56.134.194 www.eprosima.com.test" | sudo tee -a /etc/hosts
100-
sudo echo "216.58.215.164 www.acme.com.test" | sudo tee -a /etc/hosts
101-
sudo echo "2a00:1450:400e:803::2004 www.acme.com.test" | sudo tee -a /etc/hosts
102-
sudo echo "140.82.121.4 www.foo.com.test" | sudo tee -a /etc/hosts
103-
sudo echo "140.82.121.3 www.foo.com.test" | sudo tee -a /etc/hosts
104-
sudo echo "ff1e::ffff:efff:1 acme.org.test" | sudo tee -a /etc/hosts
105-
106100
# TODO(eduponz): Set up libp11 and SoftHSM. NOTE: using SoftHSM requires adding the runner to a group,
107101
# which entails logout/login or rebooting the machine. This is not feasible in a CI environment.
108102

@@ -149,9 +143,74 @@ jobs:
149143
cmake_build_type: ${{ matrix.cmake-build-type }}
150144
workspace: ${{ github.workspace }}
151145

146+
- name: Upload build artifacts
147+
uses: eProsima/eProsima-CI/external/upload-artifact@v0
148+
with:
149+
name: fastdds_build_${{ inputs.label }}
150+
path: ${{ github.workspace }}
151+
152+
fastdds_test:
153+
needs: fastdds_build
154+
if: ${{ inputs.run-tests == true }}
155+
name: fastdds_test (${{ matrix.cmake_build_type }})
156+
runs-on: macos-13
157+
strategy:
158+
fail-fast: false
159+
matrix:
160+
cmake-build-type:
161+
- 'RelWithDebInfo'
162+
steps:
163+
- name: Download build artifacts
164+
uses: eProsima/eProsima-CI/external/download-artifact@v0
165+
with:
166+
name: fastdds_build_${{ inputs.label }}
167+
path: ${{ github.workspace }}
168+
169+
- name: Fix permissions after downloading build artifacts
170+
run: |
171+
find ${{ github.workspace }}/build -type f -name "*" -exec chmod +x {} \;
172+
find ${{ github.workspace }}/install -type f -name "*" -exec chmod +x {} \;
173+
174+
- name: Install Fix Python version
175+
uses: eProsima/eProsima-CI/external/setup-python@v0
176+
with:
177+
python-version: '3.11'
178+
179+
- name: Get minimum supported version of CMake
180+
uses: eProsima/eProsima-CI/external/get-cmake@v0
181+
with:
182+
cmakeVersion: '3.22.6'
183+
184+
- name: Install brew dependencies
185+
uses: eProsima/eProsima-CI/macos/install_brew_packages@v0
186+
with:
187+
packages: llvm tinyxml2 [email protected]
188+
update: false
189+
upgrade: false
190+
191+
- name: Install colcon
192+
uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0
193+
194+
- name: Install Python dependencies
195+
uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0
196+
with:
197+
packages: vcstool xmlschema psutil
198+
upgrade: false
199+
200+
- name: Set up hosts file for DNS testing
201+
run: |
202+
sudo echo "" | sudo tee -a /etc/hosts
203+
sudo echo "127.0.0.1 localhost.test" | sudo tee -a /etc/hosts
204+
sudo echo "::1 localhost.test" | sudo tee -a /etc/hosts
205+
sudo echo "154.56.134.194 www.eprosima.com.test" | sudo tee -a /etc/hosts
206+
sudo echo "216.58.215.164 www.acme.com.test" | sudo tee -a /etc/hosts
207+
sudo echo "2a00:1450:400e:803::2004 www.acme.com.test" | sudo tee -a /etc/hosts
208+
sudo echo "140.82.121.4 www.foo.com.test" | sudo tee -a /etc/hosts
209+
sudo echo "140.82.121.3 www.foo.com.test" | sudo tee -a /etc/hosts
210+
sudo echo "ff1e::ffff:efff:1 acme.org.test" | sudo tee -a /etc/hosts
211+
152212
- name: Colcon test
153213
id: test
154-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') }}
155214
uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0
156215
with:
157216
colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_test.meta
@@ -164,7 +223,7 @@ jobs:
164223

165224
- name: Test summary
166225
uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0
167-
if: ${{ !cancelled() && !contains(github.event.pull_request.labels.*.name, 'no-test') }}
226+
if: ${{ !cancelled() }}
168227
with:
169228
junit_reports_dir: "${{ steps.test.outputs.ctest_results_path }}"
170229
print_summary: 'True'

0 commit comments

Comments
 (0)