Skip to content

Commit 7b79357

Browse files
Merge branch 'eclipse-leda:main' into main
2 parents 9e50990 + 8178142 commit 7b79357

File tree

13 files changed

+90
-45
lines changed

13 files changed

+90
-45
lines changed

.github/actions/build-container-image/action.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 Contributors to the Eclipse Foundation
1+
# Copyright 2023 Contributors to the Eclipse Foundation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.github/actions/build-native-binary/action.yaml

+52-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 Contributors to the Eclipse Foundation
1+
# Copyright 2023 Contributors to the Eclipse Foundation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -64,56 +64,92 @@ runs:
6464
-DOPENSSL_ROOT_DIR=../build_${{ matrix.arch }} \
6565
-DOPENSSL_CRYPTO_LIBRARY=../build_${{ matrix.arch }}/lib/libcrypto.so \
6666
-DSUA_BUILD_NUMBER=${{ inputs.run_number }} \
67-
-DSUA_BUILD_TESTS=NO \
67+
-DSUA_BUILD_TESTS=YES \
68+
-DSUA_MEASURE_CODE_COVERAGE=NO \
6869
..
6970
make -j
7071
make install
7172
shell: bash
7273

73-
- name: Build for ${{ inputs.arch }} (with code-coverage enabled)
74-
if: ${{ inputs.arch=='amd64' }}
74+
- name: Build for amd64 with code-coverage enabled
75+
if: ${{ inputs.arch == 'amd64' }}
7576
run: |
7677
cd build_${{ inputs.arch }}
7778
cmake \
78-
-DCMAKE_INSTALL_PREFIX=../dist_${{ inputs.arch }}_testing \
79+
-DCMAKE_INSTALL_PREFIX=../dist_${{ inputs.arch }}_codecov \
7980
-DCMAKE_TOOLCHAIN_FILE=../cmake/linux/${{ matrix.arch }}/toolchain.cmake \
8081
-DOPENSSL_ROOT_DIR=../build_${{ matrix.arch }} \
8182
-DOPENSSL_CRYPTO_LIBRARY=../build_${{ matrix.arch }}/lib/libcrypto.so \
8283
-DSUA_BUILD_NUMBER=${{ inputs.run_number }} \
8384
-DSUA_BUILD_TESTS=YES \
85+
-DSUA_MEASURE_CODE_COVERAGE=YES \
8486
..
8587
make -j
8688
make install
8789
shell: bash
8890

89-
- name: Run unit tests
90-
if: ${{ inputs.arch=='amd64' }}
91+
- name: Run unit tests for amd64
92+
if: ${{ inputs.arch == 'amd64' }}
93+
run: |
94+
cd dist_${{ inputs.arch }}/utest
95+
ls -la
96+
chmod +x TestSelfUpdateAgent
97+
uname -a
98+
file TestSelfUpdateAgent
99+
./TestSelfUpdateAgent > ../../unit_tests_report_${{ inputs.arch }}.txt
100+
shell: bash
101+
102+
- uses: uraimo/run-on-arch-action@v2
103+
name: Run unit tests for arm64
104+
if: ${{ inputs.arch == 'arm64' }}
105+
with:
106+
arch: aarch64
107+
distro: ubuntu_latest
108+
dockerRunArgs: |
109+
--volume "${PWD}:/sua"
110+
shell: /bin/sh
111+
run: |
112+
cd /sua/dist_arm64/utest
113+
ls -la ../lib
114+
ldd TestSelfUpdateAgent
115+
LD_LIBRARY_PATH=../lib ./TestSelfUpdateAgent > ../../unit_tests_report_arm64.txt
116+
117+
- name: Collect code-coverage for amd64
118+
if: ${{ inputs.arch == 'amd64' }}
91119
run: |
92-
cd dist_${{ inputs.arch }}_testing/utest
93-
./TestSelfUpdateAgent > ../../unit_tests_report.txt
120+
cd dist_${{ inputs.arch }}_codecov/utest
121+
./TestSelfUpdateAgent
94122
shell: bash
95123

96-
- name: Generate reports
97-
if: ${{ (inputs.arch=='amd64') && (success() || failure()) }}
124+
- name: Generate code-coverage report
125+
if: ${{ (inputs.arch == 'amd64') && (success() || failure()) }}
98126
run: |
99-
cd dist_${{ inputs.arch }}_testing/utest
127+
cd dist_${{ inputs.arch }}_codecov/utest
100128
101129
mkdir report
102130
gcovr --root ../.. --html --html-details --output report/coverage.html -e ../../3rdparty -e ../../utest -e ../../src/main.cpp
103131
gcovr --root ../.. --txt --output report/coverage.txt -e ../../3rdparty -e ../../utest -e ../../src/main.cpp
104132
tar -czvf ../../code-coverage.tar.gz report
105133
106-
echo -e "### Code Coverage Summary\n" >> report.md
134+
echo -e "### Code-coverage summary for" ${{ inputs.arch }} "\n" >> report.md
107135
echo -e "\`\`\`" >> report.md
108136
cat report/coverage.txt >> report.md
109137
echo -e "\n\`\`\`\n" >> report.md
110138
111-
echo -e "### Unit Tests Results\n" >> report.md
139+
cat report.md >> $GITHUB_STEP_SUMMARY
140+
shell: bash
141+
142+
- name: Generate unit tests report for ${{ inputs.arch }}
143+
if: ${{ success() || failure() }}
144+
run: |
145+
cd dist_${{ inputs.arch }}/utest
146+
147+
echo -e "### Unit tests results for" ${{ inputs.arch }} "\n" >> report.md
112148
echo -e "\`\`\`" >> report.md
113-
cat ../../unit_tests_report.txt >> report.md
149+
cat ../../unit_tests_report_${{ inputs.arch }}.txt >> report.md
114150
echo -e "\n\`\`\`\n" >> report.md
115151
116-
cat report.md > $GITHUB_STEP_SUMMARY
152+
cat report.md >> $GITHUB_STEP_SUMMARY
117153
shell: bash
118154

119155
- name: Compress artifacts

.github/workflows/main.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 Contributors to the Eclipse Foundation
1+
# Copyright 2023 Contributors to the Eclipse Foundation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -98,17 +98,16 @@ jobs:
9898
with:
9999
path: self-update-agent-${{ matrix.arch }}-build-${{ github.run_number }}.tar.gz
100100

101-
- name: Upload code coverage results to workspace
101+
- name: Upload code-coverage results to workspace
102102
if: ${{ matrix.arch == 'amd64' }}
103103
uses: actions/upload-artifact@v3
104104
with:
105105
path: code-coverage.tar.gz
106106

107107
- name: Upload unit tests results to workspace
108-
if: ${{ matrix.arch == 'amd64' }}
109108
uses: actions/upload-artifact@v3
110109
with:
111-
path: unit_tests_report.txt
110+
path: unit_tests_report_${{ matrix.arch }}.txt
112111

113112
upload-native-binary:
114113
runs-on: ubuntu-latest
@@ -131,7 +130,8 @@ jobs:
131130
automatic_release_tag: build_${{ github.run_number }}
132131
title: "Build ${{ github.run_number }}"
133132
files: |
134-
./artifact/unit_tests_report.txt
133+
./artifact/unit_tests_report_amd64.txt
134+
./artifact/unit_tests_report_arm64.txt
135135
./artifact/code-coverage.tar.gz
136136
./artifact/self-update-agent-amd64-build-${{ github.run_number }}.tar.gz
137137
./artifact/self-update-agent-arm64-build-${{ github.run_number }}.tar.gz

.github/workflows/main_developer.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 Contributors to the Eclipse Foundation
1+
# Copyright 2023 Contributors to the Eclipse Foundation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.github/workflows/ocaas.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 Contributors to the Eclipse Foundation
1+
# Copyright 2023 Contributors to the Eclipse Foundation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

3rdparty/CMakeLists.txt

+15
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,18 @@ add_subdirectory(curl)
2525
if(SUA_BUILD_TESTS)
2626
add_subdirectory(googletest)
2727
endif()
28+
29+
install(
30+
FILES
31+
${CMAKE_BINARY_DIR}/lib/libssl.so.3
32+
${CMAKE_BINARY_DIR}/lib/libcrypto.so.3
33+
${CMAKE_BINARY_DIR}/3rdparty/curl/lib/libcurl.so
34+
${CMAKE_BINARY_DIR}/glib/subprojects/zlib-1.2.11/libz.so
35+
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
36+
)
37+
38+
install(FILES ${CMAKE_BINARY_DIR}/glib/gio/libgio-2.0.so.0.7300.0 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib RENAME libgio-2.0.so.0)
39+
install(FILES ${CMAKE_BINARY_DIR}/glib/glib/libglib-2.0.so.0.7300.0 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib RENAME libglib-2.0.so.0)
40+
install(FILES ${CMAKE_BINARY_DIR}/glib/gmodule/libgmodule-2.0.so.0.7300.0 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib RENAME libgmodule-2.0.so.0)
41+
install(FILES ${CMAKE_BINARY_DIR}/glib/gobject/libgobject-2.0.so.0.7300.0 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib RENAME libgobject-2.0.so.0)
42+
install(FILES ${CMAKE_BINARY_DIR}/glib/subprojects/libffi/src/libffi.so.7.1.0 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib RENAME libffi.so.7)

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
88
set(CMAKE_INSTALL_RPATH ../lib)
99

1010
option(SUA_BUILD_TESTS "Build unit tests with code-coverage report enabled" OFF)
11+
option(SUA_MEASURE_CODE_COVERAGE "Measure code-coverage" OFF)
1112

1213
include(cmake/dependencies.cmake)
1314

cmake/dependencies.cmake

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ else ()
1212
)
1313
endif()
1414

15-
1615
add_library(ssl_lib SHARED IMPORTED)
1716
set_property(
1817
TARGET ssl_lib

scripts/build_glib_amd64.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

33
cd 3rdparty/glib
4-
meson subprojects download
5-
meson setup -Dwrap_mode=forcefallback ../../build_amd64/glib
6-
meson compile -j `nproc` -C ../../build_amd64/glib
4+
meson subprojects download > /dev/null
5+
meson setup -Dwrap_mode=forcefallback ../../build_amd64/glib > /dev/null
6+
meson compile -j `nproc` -C ../../build_amd64/glib > /dev/null

scripts/build_glib_arm64.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

33
cd 3rdparty/glib
4-
meson subprojects download
5-
meson setup -Dwrap_mode=forcefallback --cross-file=../meson-cross-file-aarch64.txt ../../build_arm64/glib
6-
meson compile -j `nproc` -C ../../build_arm64/glib
4+
meson subprojects download > /dev/null
5+
meson setup -Dwrap_mode=forcefallback --cross-file=../meson-cross-file-aarch64.txt ../../build_arm64/glib > /dev/null
6+
meson compile -j `nproc` -C ../../build_arm64/glib > /dev/null

scripts/build_openssl_amd64.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ cd build_amd64/3rdparty/openssl
99
--libdir=lib \
1010
shared \
1111
-Wl,-rpath=$rootdir/build_amd64/lib \
12-
-Wl,--enable-new-dtags
13-
make -j
14-
make install_sw
12+
-Wl,--enable-new-dtags > /dev/null
13+
make -j > /dev/null
14+
make install_sw > /dev/null

scripts/build_openssl_arm64.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ RANLIB=aarch64-linux-gnu-ranlib \
1414
--libdir=lib \
1515
shared \
1616
-Wl,-rpath=$rootdir/build_arm64/lib \
17-
-Wl,--enable-new-dtags
18-
make -j
19-
make install_sw
17+
-Wl,--enable-new-dtags > /dev/null
18+
make -j > /dev/null
19+
make install_sw > /dev/null

src/CMakeLists.txt

+2-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if(NOT DEFINED SUA_BUILD_NUMBER)
1010
set(SUA_BUILD_NUMBER "local")
1111
endif()
1212

13-
if(SUA_BUILD_TESTS)
13+
if(SUA_MEASURE_CODE_COVERAGE)
1414
add_compile_options(
1515
-fprofile-arcs
1616
-ftest-coverage
@@ -63,16 +63,10 @@ target_link_libraries(${PROJECT_NAME}
6363
sua
6464
)
6565

66-
if(SUA_BUILD_TESTS)
66+
if(SUA_MEASURE_CODE_COVERAGE)
6767
target_link_libraries(sua gcov)
6868
endif()
6969

7070
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
7171
install(TARGETS sua LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
7272

73-
install(
74-
FILES
75-
${CMAKE_BINARY_DIR}/lib/libssl.so.3
76-
${CMAKE_BINARY_DIR}/lib/libcrypto.so.3
77-
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
78-
)

0 commit comments

Comments
 (0)