-
Notifications
You must be signed in to change notification settings - Fork 6
176 lines (151 loc) · 5.88 KB
/
build.yml
File metadata and controls
176 lines (151 loc) · 5.88 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master,dev/develop,dev/migration_gcc_desktop_build]
pull_request:
branches: [ master,dev/develop]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build-windows-simulator:
# The type of runner that the job will run on
runs-on: windows-latest
env:
buildDir: '${{ github.workspace }}\build'
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install conan
uses: BSFishy/pip-action@v1
with:
packages: |
conan
#Install the latest cmake
- name : Get the latest CMake version
uses: lukka/get-cmake@latest
- name: Run build for MSVC compiler
run: |
cmake -G"Visual Studio 16 2019" -Ax64 -S"${{ github.workspace }}/Firmware/" -B"${{ env.buildDir }}" -DPACKAGE_TESTS=ON -DTARGET_PLATFORM:STRING="FIRMWARE_SIMULATOR" -DCMAKE_BUILD_TYPE=Release
cd ${{ env.buildDir }}
cmake --build . --config Release
- name : Run firmware testing
run: |
cd ${{ env.buildDir }}/Release
.\FirmwareTesting.exe
build-arm:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
submodules: 'true'
#Install the latest cmake
- name : Get the latest CMake version
uses: lukka/get-cmake@latest
# - name: Get the latest arm-none-eabi-gcc
# uses: fiam/arm-none-eabi-gcc@v1
# with:
# release: '10-2020-q2'
# directory: ${{ github.workspace }}/toolchain
- name: Cache GCC toolchain
id: cache-gcc-toolchain
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/gcc_toolchain_10_3
key: ${{runner.os}}-toolchain-v10_3
- name: Get the latest arm-gcc-none-eabi-gcc
uses: wei/wget@v1
if: steps.cache-gcc-toolchain.outputs.cache-hit != 'true'
id: download-arm-gcc
with:
args: 'https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.07/gcc-arm-none-eabi-10.3-2021.07-x86_64-linux.tar.bz2'
- name: Unpack arm-gcc-compiler
if: steps.cache-gcc-toolchain.outputs.cache-hit != 'true'
run: |
mkdir gcc_toolchain_10_3
tar -xjf gcc-arm-none-eabi-10.3-2021.07-x86_64-linux.tar.bz2 --directory ${{ github.workspace }}/gcc_toolchain_10_3
- name: Cache NordicSDK
id: cache-nordic-sdk
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/Nrf52SDKv16_0
key: ${{runner.os}}-nordic-sdk-v16-0
- name: Get NRF52 16.0 SDK
uses: wei/wget@v1
id: download-nrf52sdk
if: steps.cache-nordic-sdk.outputs.cache-hit != 'true'
with:
args: 'https://www.nordicsemi.com/-/media/Software-and-other-downloads/SDKs/nRF5/Binaries/nRF5SDK160098a08e2.zip'
- name: Unpack NordicSDK
if: steps.cache-nordic-sdk.outputs.cache-hit != 'true'
run: |
mkdir Nrf52SDKv16_0
unzip nRF5SDK160098a08e2.zip -d Nrf52SDKv16_0
mv Nrf52SDKv16_0/components/boards/pca10040.h Nrf52SDKv16_0/components/boards/pca10040_1.h
- name: Run CMakeLists generation for GCC compiler
uses: lukka/run-cmake@v2
with:
cmakeGenerator: Ninja
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: ${{ github.workspace }}/Firmware/CMakeLists.txt
cmakeBuildType: Debug
cmakeAppendedArgs : '-DTARGET_PLATFORM:STRING="ARM_CORTEX" -DEXECUTE_MCU_FLASHING=OFF -DCMAKE_BUILD_TYPE:STRING=Debug -DREDUCE_LVGL_BINARY_SIZE=ON -DPACKAGE_TESTS=OFF -DNRF5_SDK_PATH=${{ github.workspace }}/Nrf52SDKv16_0 -DARM_NONE_EABI_TOOLCHAIN_PATH:PATH=${{ github.workspace }}/gcc_toolchain_10_3/gcc-arm-none-eabi-10.3-2021.07'
buildWithCMake: true
# # Runs a set of commands using the runners shell
# - name: Run a multi-line script
# run: |
# echo Add other actions to build,
# echo test, and deploy your project.
build-linux-desktop-simulator:
runs-on: ubuntu-latest
env:
buildDir: '${{ github.workspace }}/build'
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install conan
uses: BSFishy/pip-action@v1
with:
packages: |
conan
- name: Intall system required packages
run: |
sudo apt-get update
sudo apt-get install -y libegl-dev
#Install the latest cmake
- name : Get the latest CMake version
uses: lukka/get-cmake@latest
- name: Set up GCC 11
uses: egor-tensin/setup-gcc@v1
with:
version: 11
platform: x64
- name: Run CMakeLists generation for GCC compiler
uses: lukka/run-cmake@v2
with:
cmakeGenerator: Unix Makefiles
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: ${{ github.workspace }}/Firmware/CMakeLists.txt
cmakeBuildType: Debug
cmakeAppendedArgs : '-DTARGET_PLATFORM:STRING="FIRMWARE_SIMULATOR" -DCMAKE_BUILD_TYPE:STRING=Debug -DREDUCE_LVGL_BINARY_SIZE=OFF -DPACKAGE_TESTS=ON -DENABLE_SANITIZE_BUILD=ON'
buildDirectory: ${{ env.buildDir }}
buildWithCMake: true
- name : Run firmware testing
run: |
cd ${{ env.buildDir }}
./FirmwareTesting