Skip to content

Commit 160997e

Browse files
authored
Merge pull request tier4#1586 from tier4/feature/arm64-buildtest
Add arm64 build test
2 parents fe5dbd6 + ea63834 commit 160997e

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed

.github/workflows/BuildAndRun.yaml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
fail-fast: false
3434
matrix:
3535
rosdistro: [humble]
36-
runs_on: [ubuntu-22.04] # macos-14 is added for arm support. See also https://x.com/github/status/1752458943245189120?s=20
36+
runs_on: [ubuntu-22.04, ubuntu-22.04-arm]
3737
cmake_build_type: [RelWithDebInfo, Release] # Debug build type is currently unavailable. @TODO Fix problem and add Debug build.
3838
steps:
3939
- name: Suppress warnings
@@ -76,26 +76,32 @@ jobs:
7676
colcon mixin update default
7777
shell: bash
7878

79-
- name: Install sonar-scanner and build-wrapper
80-
uses: sonarsource/sonarcloud-github-c-cpp@v3
79+
- name: Install Build Wrapper
80+
uses: SonarSource/sonarqube-scan-action/[email protected]
81+
id: build_wrapper
8182
env:
8283
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
8384

8485
- name: Build with SonarCloud Build Wrapper
86+
# Note: `-Wno-error=class-memaccess` is temporary workaround for aarch64 GCC error
87+
# This should be removed when Eigen is updated in Ubuntu package repository
88+
# See also: https://gitlab.com/libeigen/eigen/-/issues/2326
8589
run: |
8690
source /opt/ros/${{ matrix.rosdistro }}/setup.bash
87-
build-wrapper-linux-x86-64 --out-dir src/scenario_simulator_v2/bw-output \
91+
${{ steps.build_wrapper.outputs.build-wrapper-binary }} --out-dir src/scenario_simulator_v2/bw-output \
8892
colcon build --symlink-install \
8993
--cmake-args \
9094
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
9195
-DBUILD_CPP_MOCK_SCENARIOS=ON \
9296
-DBUILD_TESTING=true \
93-
-DCMAKE_CXX_FLAGS='-fprofile-arcs -ftest-coverage' \
97+
-DCMAKE_CXX_FLAGS='-fprofile-arcs -ftest-coverage -Wno-error=class-memaccess' \
9498
-DCMAKE_C_FLAGS='-fprofile-arcs -ftest-coverage' \
9599
--packages-up-to ${{ steps.list_packages.outputs.package_list }}
96100
shell: bash
97101

98102
- name: Colcon test
103+
# ARM testing is currently broken
104+
if: matrix.runs_on != 'ubuntu-22.04-arm'
99105
run: |
100106
source /opt/ros/${{ matrix.rosdistro }}/setup.bash
101107
source install/local_setup.bash
@@ -104,6 +110,7 @@ jobs:
104110
shell: bash
105111

106112
- name: generate gcov report for sonarcloud
113+
if: matrix.runs_on != 'ubuntu-22.04-arm'
107114
run: gcovr -r src/scenario_simulator_v2 build --sonarqube coverage.xml
108115

109116
- name: Show test result
@@ -115,6 +122,7 @@ jobs:
115122
shell: bash
116123

117124
- name: Scenario test
125+
if: matrix.runs_on != 'ubuntu-22.04-arm'
118126
run: |
119127
source install/setup.bash
120128
source install/local_setup.bash
@@ -123,6 +131,7 @@ jobs:
123131

124132
- name: Scenario test (optional)
125133
id: optional-scenario-test
134+
if: matrix.runs_on != 'ubuntu-22.04-arm'
126135
run: |
127136
source install/setup.bash
128137
source install/local_setup.bash
@@ -133,7 +142,7 @@ jobs:
133142
shell: bash
134143

135144
- uses: actions/github-script@v7
136-
if: steps.optional-scenario-test.outputs.failure > 0
145+
if: steps.optional-scenario-test.outputs.failure > 0 && matrix.runs_on != 'ubuntu-22.04-arm'
137146
with:
138147
github-token: ${{ secrets.GITHUB_TOKEN }}
139148
script: |
@@ -151,26 +160,32 @@ jobs:
151160
152161
- name: Upload Lcov result
153162
uses: actions/upload-artifact@v4
163+
if: matrix.runs_on != 'ubuntu-22.04-arm'
154164
with:
155165
name: lcov-${{ matrix.cmake_build_type }}
156166
path: lcov
157167
retention-days: 1
158168

159169
- name: Upload Gcov result
160170
uses: actions/upload-artifact@v4
171+
if: matrix.runs_on != 'ubuntu-22.04-arm'
161172
with:
162173
name: coverage${{ matrix.cmake_build_type }}.xml
163174
path: coverage.xml
164175
retention-days: 1
165176

166-
- name: Run SonarCloud scan
177+
- name: SonarQube Scan
178+
uses: SonarSource/[email protected]
179+
# In ARM build, SonarQube result should be same as x86 build because no test runs
180+
if: matrix.runs_on != 'ubuntu-22.04-arm'
167181
env:
168182
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
169183
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
170-
SONAR_HOST_URL: https://sonarcloud.io/
171-
working-directory: src/scenario_simulator_v2/
172-
run: sonar-scanner --define sonar.cfamily.compile-commands="bw-output/compile_commands.json"
173-
184+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
185+
with:
186+
args: >
187+
--define sonar.cfamily.compile-commands="src/scenario_simulator_v2/bw-output/compile_commands.json"
188+
projectBaseDir: src/scenario_simulator_v2/
174189
# - name: Basic test
175190
# run: |
176191
# source install/setup.bash

0 commit comments

Comments
 (0)