Skip to content

Commit 041e2b0

Browse files
ValentiWorkLearningValentyn Korniienko
andauthored
Draft implementation of Linux-simulator build environment (#30)
* Draft of the migration to GCC compiler desktop build * Updated workflows file * Updated falgs for building with coroutines in the GNU compiler * After merge corrections * Removed old branches from the build.yml config * Updated workflows file for the github actions. Removed conan libraries download step. Changed simulator build directory * Attempted to fixup CI * Added linux-desktop-configuration build * Fixed syntax issues in build.yml * Added installation of libegl-dev * Fixed indentation in build.yml * Attempted to fixup windows build * sudo apt-get on linux * Added packages update for linux desktop * Attempted to fixup windows build * Fixed build.yml windows build directory * Fixed windows build workflow. Added Test running under linux-desktop * Renamed linux desktop to linux dekstop simulator CI Co-authored-by: Valentyn Korniienko <[email protected]>
1 parent 7c98319 commit 041e2b0

File tree

9 files changed

+124
-24
lines changed

9 files changed

+124
-24
lines changed

.github/workflows/build.yml

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ name: CI
44
# events but only for the master branch
55
on:
66
push:
7-
branches: [ master,dev/develop,dev/coroutine,dev/build_ci_speedup]
7+
branches: [ master,dev/develop,dev/migration_gcc_desktop_build]
88
pull_request:
9-
branches: [ master,dev/develop,dev/coroutine]
9+
branches: [ master,dev/develop]
1010

1111
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1212
jobs:
1313
# This workflow contains a single job called "build"
1414
build-windows-simulator:
1515
# The type of runner that the job will run on
1616
runs-on: windows-latest
17-
17+
env:
18+
buildDir: '${{ github.workspace }}\build'
1819
# Steps represent a sequence of tasks that will be executed as part of the job
1920
steps:
2021
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
@@ -33,11 +34,6 @@ jobs:
3334
packages: |
3435
conan
3536
36-
- name: Download libraries from Conan
37-
run: |
38-
mkdir ${{ runner.workspace }}/build/vsfirmwarebuild/Debug
39-
conan install ${{ github.workspace }}/Firmware/conanfile.txt --install-folder ${{ runner.workspace }}/build/vsfirmwarebuild/
40-
4137
#Install the latest cmake
4238
- name : Get the latest CMake version
4339
uses: lukka/get-cmake@latest
@@ -50,11 +46,11 @@ jobs:
5046
cmakeListsTxtPath: ${{ github.workspace }}/Firmware/CMakeLists.txt
5147
cmakeBuildType: Debug
5248
cmakeAppendedArgs: '-DPACKAGE_TESTS=ON -DTARGET_PLATFORM:STRING="FIRMWARE_SIMULATOR" -DCMAKE_BUILD_TYPE:STRING=Release'
53-
buildDirectory: '${{ runner.workspace }}/build/vsfirmwarebuild'
49+
buildDirectory: ${{ env.buildDir }}
5450
buildWithCMake: true
5551
- name : Run firmware testing
5652
run: |
57-
cd ${{ runner.workspace }}/build/vsfirmwarebuild/bin
53+
cd ${{ env.buildDir }}\Debug
5854
.\FirmwareTesting.exe
5955
build-arm:
6056

@@ -132,3 +128,54 @@ jobs:
132128
# run: |
133129
# echo Add other actions to build,
134130
# echo test, and deploy your project.
131+
build-linux-desktop-simulator:
132+
runs-on: ubuntu-latest
133+
env:
134+
buildDir: '${{ github.workspace }}/build'
135+
steps:
136+
137+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
138+
- uses: actions/checkout@v2
139+
with:
140+
submodules: 'true'
141+
142+
- name: Setup python
143+
uses: actions/setup-python@v2
144+
with:
145+
python-version: '3.8'
146+
147+
- name: Install conan
148+
uses: BSFishy/pip-action@v1
149+
with:
150+
packages: |
151+
conan
152+
153+
- name: Intall system required packages
154+
run: |
155+
sudo apt-get update
156+
sudo apt-get install -y libegl-dev
157+
#Install the latest cmake
158+
- name : Get the latest CMake version
159+
uses: lukka/get-cmake@latest
160+
161+
- name: Set up GCC 11
162+
uses: egor-tensin/setup-gcc@v1
163+
with:
164+
version: 11
165+
platform: x64
166+
167+
- name: Run CMakeLists generation for GCC compiler
168+
uses: lukka/run-cmake@v2
169+
with:
170+
cmakeGenerator: Unix Makefiles
171+
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
172+
cmakeListsTxtPath: ${{ github.workspace }}/Firmware/CMakeLists.txt
173+
cmakeBuildType: Debug
174+
cmakeAppendedArgs : '-DTARGET_PLATFORM:STRING="FIRMWARE_SIMULATOR" -DCMAKE_BUILD_TYPE:STRING=Debug -DREDUCE_LVGL_BINARY_SIZE=OFF -DPACKAGE_TESTS=ON -DENABLE_SANITIZE_BUILD=ON'
175+
buildDirectory: ${{ env.buildDir }}
176+
buildWithCMake: true
177+
178+
- name : Run firmware testing
179+
run: |
180+
cd ${{ env.buildDir }}
181+
./FirmwareTesting

Firmware/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ target_compile_features(
9595
cxx_std_20
9696
)
9797

98+
target_compile_options(
99+
${NORDIC_TARGET}
100+
PRIVATE
101+
$<$<CXX_COMPILER_ID:GNU>:-fcoroutines>
102+
)
103+
98104
if( ${TARGET_PLATFORM} STREQUAL "ARM_CORTEX" )
99105
target_link_libraries(
100106
${NORDIC_TARGET} PRIVATE

Firmware/drivers/board/CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ if( ${TARGET_PLATFORM} STREQUAL "ARM_CORTEX" )
4343
PUBLIC
4444
USE_DEVICE_SPECIFIC
4545
)
46-
target_compile_options(
47-
watchboard
48-
PRIVATE
49-
-fcoroutines
50-
)
5146
elseif( ${TARGET_PLATFORM} STREQUAL "FIRMWARE_SIMULATOR")
5247
endif()
48+
49+
50+
target_compile_options(
51+
watchboard
52+
PRIVATE
53+
$<$<CXX_COMPILER_ID:GNU>:-fcoroutines>
54+
)

Firmware/drivers/board/inc/board/hardware_usings.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ using TFlashDriver = ExternalFlash::WinbondFlashDriver<
2323
#else
2424
using BoardTimer = Buttons::NordicTimerBackend;
2525
using ButtonsBackend = Buttons::NordicButtonsBackend;
26-
using TFlashDriver = ExternalFlash::WinbondFlashDriver<Interface::SpiTemplated::SpiBus<
27-
Interface::SpiTemplated::NordicSpi<Interface::SpiTemplated::SpiInstance::M1,Interface::SpiTemplated::SpiInstance::ChipSelectDrivenByUser>>>;
26+
using TFlashDriver = ExternalFlash::WinbondFlashDriver<
27+
Interface::SpiTemplated::SpiBus<Interface::SpiTemplated::NordicSpi<
28+
Interface::SpiTemplated::SpiInstance::M1,
29+
Interface::SpiTemplated::SpiInstance::ChipSelectDrivenByUser>>>;
2830
#endif
2931

3032
using ButtonsDriver = Buttons::ButtonsDriverTemplate<BoardTimer, ButtonsBackend>;

Firmware/drivers/buttons/bt_firmware_simulator_hardware_buttons_manual_backend.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
#include "inc/buttons/bt_firmware_simulator_hardware_buttons_manual_backend.hpp"
23

34
#include <utils/CallbackConnector.hpp>
@@ -10,6 +11,7 @@
1011
namespace Buttons
1112
{
1213

14+
1315
FirmwareSimulatorTimerBackend::FirmwareSimulatorTimerBackend() : m_isTimerEllapsed{true}
1416
{
1517
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#include "inc/buttons/bt_os_hardware_buttons_manual_backend.hpp"
2+
3+
#include "utils/CallbackConnector.hpp"
4+
#include "utils/MetaUtils.hpp"
5+
6+
namespace Buttons
7+
{
8+
9+
OsTimerBackend::OsTimerBackend() : m_isTimerEllapsed{true}
10+
{
11+
}
12+
13+
void OsTimerBackend::startTimer()
14+
{
15+
}
16+
17+
void OsTimerBackend::stopTimer()
18+
{
19+
}
20+
21+
void OsTimerBackend::initialize()
22+
{
23+
}
24+
25+
bool OsTimerBackend::isTimerEllapsed() const
26+
{
27+
return m_isTimerEllapsed;
28+
}
29+
30+
OsButtonsBackend::OsButtonsBackend()
31+
{
32+
}
33+
34+
void OsButtonsBackend::initialize()
35+
{
36+
}
37+
38+
} // namespace Buttons

Firmware/drivers/buttons/inc/buttons/bt_firmware_simulator_hardware_buttons_manual_backend.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
namespace Buttons
88
{
9-
109
class FirmwareSimulatorTimerBackend
1110
{
1211

@@ -42,7 +41,6 @@ class FirmwareSimulatorButtonsBackend
4241

4342
public:
4443
void initialize();
45-
4644
private:
4745
void initInternals();
4846
};

Firmware/drivers/spi/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ add_library(
66
if( ${TARGET_PLATFORM} STREQUAL "ARM_CORTEX" )
77

88
target_link_libraries( spi INTERFACE NordicSDK::Common )
9-
target_compile_options(
10-
spi
11-
INTERFACE
12-
-fcoroutines
13-
)
149
endif()
1510

11+
target_compile_options(
12+
spi
13+
INTERFACE
14+
$<$<CXX_COMPILER_ID:GNU>:-fcoroutines>
15+
)
1616

1717
target_include_directories(
1818
spi

Firmware/utils/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,8 @@ target_link_libraries(
3636
etl
3737
logger_service
3838
)
39+
target_compile_options(
40+
UtilsLibrary
41+
INTERFACE
42+
$<$<CXX_COMPILER_ID:GNU>:-fcoroutines>
43+
)

0 commit comments

Comments
 (0)