]> begriffs open source - freertos/blob - .github/workflows/kernel-demos.yml
FreeRTOS MPU: Remove MPU region number check (#1261)
[freertos] / .github / workflows / kernel-demos.yml
1 name: FreeRTOS-Kernel Demos
2 on: [push, pull_request]
3
4 env:
5   # The bash escape character is \033
6   bashPass:   \033[32;1mPASSED -
7   bashInfo:   \033[33;1mINFO -
8   bashFail:   \033[31;1mFAILED -
9   bashEnd:    \033[0m
10
11 jobs:
12   WIN32-MSVC:
13     name: WIN32 MSVC
14     runs-on: windows-latest
15     steps:
16       - name: Checkout the FreeRTOS/FreeRTOS Repository
17         uses: actions/checkout@v4.1.1
18         with:
19           ref: main
20           repository: FreeRTOS/FreeRTOS
21           submodules: 'recursive'
22           fetch-depth: 1
23
24       # Checkout user pull request changes
25       - name: Checkout Pull Request
26         uses: actions/checkout@v4.1.1
27         with:
28           path: ./FreeRTOS/Source
29
30       - name: Add msbuild to PATH
31         uses: microsoft/setup-msbuild@v1.1
32
33       - name: Build WIN32-MSVC Demo
34         working-directory: FreeRTOS/Demo/WIN32-MSVC
35         run: msbuild WIN32.sln -t:rebuild
36
37       - name: Build WIN32-MSVC-Static-Allocation-Only Demo
38         working-directory: FreeRTOS/Demo/WIN32-MSVC-Static-Allocation-Only
39         run: msbuild WIN32.sln -t:rebuild
40
41   WIN32-MingW:
42     name: WIN32 MingW
43     runs-on: windows-latest
44     steps:
45       - name: Checkout the FreeRTOS/FreeRTOS Repository
46         uses: actions/checkout@v4.1.1
47         with:
48           ref: main
49           repository: FreeRTOS/FreeRTOS
50           submodules: 'recursive'
51           fetch-depth: 1
52
53       # Checkout user pull request changes
54       - name: Checkout Pull Request
55         uses: actions/checkout@v4.1.1
56         with:
57           path: ./FreeRTOS/Source
58
59       - name: Build WIN32-MingW Demo
60         working-directory: FreeRTOS/Demo/WIN32-MingW
61         run: |
62           gcc --version
63           make --version
64           make
65
66   POSIX-GCC:
67     name: Native GCC
68     strategy:
69       fail-fast: false
70       matrix:
71         os:
72           - macos-latest
73           - ubuntu-latest
74     runs-on: ${{ matrix.os }}
75     steps:
76       - name: Checkout the FreeRTOS/FreeRTOS Repository
77         uses: actions/checkout@v4.1.1
78         with:
79           ref: main
80           repository: FreeRTOS/FreeRTOS
81           submodules: 'recursive'
82           fetch-depth: 1
83
84       # Checkout user pull request changes
85       - name: Checkout Pull Request
86         uses: actions/checkout@v4.1.1
87         with:
88           path: ./FreeRTOS/Source
89
90       - name: Install GCC
91         shell: bash
92         if: matrix.os == 'ubuntu-latest'
93         run: |
94           sudo apt-get -y update
95           sudo apt-get -y install build-essential
96
97       - name: Build Posix_GCC Demo
98         shell: bash
99         working-directory: FreeRTOS/Demo/Posix_GCC
100         run: make -j
101
102       - name: Build Posix_GCC Demo for Coverage Test
103         shell: bash
104         working-directory: FreeRTOS/Demo/Posix_GCC
105         run: make -j COVERAGE_TEST=1
106
107   CMake-Example:
108     name: CMake Example with Native GCC
109     runs-on: ubuntu-latest
110     steps:
111       # Checkout user pull request changes
112       - name: Checkout Repository
113         uses: actions/checkout@v4.1.1
114
115       - name: Install GCC
116         shell: bash
117         run: |
118           sudo apt-get -y update
119           sudo apt-get -y install build-essential
120
121       - name: Build CMake Example Demo
122         shell: bash
123         working-directory: examples/cmake_example
124         run: |
125           cmake -S . -B build
126           cmake --build build
127
128       - name: Build CMake SMP Example Demo
129         shell: bash
130         working-directory: examples/cmake_example
131         run: |
132           cmake -S . -B build -DFREERTOS_SMP_EXAMPLE=1
133           cmake --build build
134
135   MSP430-GCC:
136     name: GNU MSP430 Toolchain
137     runs-on: ubuntu-latest
138     steps:
139       - name: Checkout the FreeRTOS/FreeRTOS Repository
140         uses: actions/checkout@v4.1.1
141         with:
142           ref: main
143           repository: FreeRTOS/FreeRTOS
144           submodules: 'recursive'
145           fetch-depth: 1
146
147       # Checkout user pull request changes
148       - name: Checkout Pull Request
149         uses: actions/checkout@v4.1.1
150         with:
151           path: ./FreeRTOS/Source
152
153       - env:
154           stepName: Install MSP430 Toolchain
155         shell: bash
156         run: |
157           # ${{ env.stepName }}
158           echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
159           curl -L -O https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-LlCjWuAbzH/9.3.1.2/msp430-gcc-full-linux-x64-installer-9.3.1.2.7z
160           sudo apt update -y
161           sudo apt install -y p7zip-full
162           7z x ./msp430-gcc-full-linux-x64-installer-9.3.1.2.7z
163           chmod +x ./msp430-gcc-full-linux-x64-installer-9.3.1.2.run
164           sudo ./msp430-gcc-full-linux-x64-installer-9.3.1.2.run --prefix /usr/bin/msp430-gcc --mode unattended
165           echo "::endgroup::"
166           echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
167
168       - name: Build msp430_GCC Demo
169         shell: bash
170         working-directory: FreeRTOS/Demo/msp430_GCC
171         run: make -j CC=/usr/bin/msp430-gcc/bin/msp430-elf-gcc OPT="-Os -I/usr/bin/msp430-gcc/include -L/usr/bin/msp430-gcc/include"
172
173   MicroBlaze-GCC:
174     name: GCC MicroBlaze Toolchain
175     runs-on: ubuntu-latest
176     steps:
177       - name: Checkout the FreeRTOS/FreeRTOS Repository
178         uses: actions/checkout@v4.1.1
179         with:
180           ref: main
181           repository: FreeRTOS/FreeRTOS
182           fetch-depth: 1
183
184       - env:
185           stepName: Fetch Community-Supported-Demos Submodule
186         shell: bash
187         run: |
188           # ${{ env.stepName }}
189           echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
190           git submodule update --checkout --init --depth 1 FreeRTOS/Demo/ThirdParty/Community-Supported-Demos
191           # This repository contains the microblaze_instructions.h header file
192           git clone https://github.com/Xilinx/embeddedsw.git --branch xilinx_v2023.1
193           echo "::endgroup::"
194           echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
195
196       # Checkout user pull request changes
197       - name: Checkout Pull Request
198         uses: actions/checkout@v4.1.1
199         with:
200           path: ./FreeRTOS/Source
201
202       - env:
203           stepName: Install Dependancies
204         shell: bash
205         run: |
206           # ${{ env.stepName }}
207           echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
208           sudo apt update -y
209           sudo apt upgrade -y
210           sudo apt install -y build-essential m4 debhelper bison texinfo dejagnu flex
211           sudo apt install -y autogen gawk libgmp-dev libmpc-dev libmpfr-dev
212           sudo apt install -y patchutils sharutils zlib1g-dev autoconf2.64
213
214           # Download the mb-gcc toolchain from github
215           curl -L -O https://github.com/mdednev/mb-gcc/releases/download/2021-0623%2B2/binutils-microblaze_2.35-2021-0623+1_amd64.deb;
216           curl -L -O https://github.com/mdednev/mb-gcc/releases/download/2021-0623%2B2/gcc-microblaze_10.2.0-2021-0623+2_amd64.deb;
217           curl -L -O https://github.com/mdednev/mb-gcc/releases/download/2021-0623%2B2/libnewlib-microblaze-dev_3.3.0-2021-0623+3_all.deb;
218           curl -L -O https://github.com/mdednev/mb-gcc/releases/download/2021-0623%2B2/libnewlib-microblaze-doc_3.3.0-2021-0623+3_all.deb;
219           curl -L -O https://github.com/mdednev/mb-gcc/releases/download/2021-0623%2B2/libnewlib-microblaze_3.3.0-2021-0623+3_all.deb;
220           curl -L -O https://github.com/mdednev/mb-gcc/releases/download/2021-0623%2B2/newlib-source_3.3.0-2021-0623+3_all.deb;
221
222           # Install the packages for the toolchain
223           sudo apt install -y ./binutils-microblaze*.deb;
224           sudo apt install -y ./gcc-microblaze*.deb;
225           sudo apt install -y ./libnewlib-microblaze-dev*.deb;
226           sudo apt install -y ./libnewlib-microblaze-doc*.deb;
227           sudo apt install -y ./libnewlib-microblaze*.deb;
228           sudo apt install -y ./newlib-source*.deb;
229
230           # Validate that the toolchain is in the path and can be called
231           which mb-gcc
232           mb-gcc --version
233
234           echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
235
236       - env:
237           stepName: Compile Microblaze Port
238         shell: bash
239         run: |
240           # ${{ env.stepName }}
241           echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
242           # Compile MicroBlazeV9 Port files to validate they build
243           mb-gcc -mcpu=v9.5 -c \
244             FreeRTOS/Source/portable/GCC/MicroBlazeV9/port.c \
245             FreeRTOS/Source/portable/GCC/MicroBlazeV9/portasm.S \
246             FreeRTOS/Source/portable/GCC/MicroBlazeV9/port_exceptions.c \
247             FreeRTOS/Source/tasks.c \
248             FreeRTOS/Source/list.c \
249             -I embeddedsw/lib/bsp/standalone/src/microblaze \
250             -I FreeRTOS/Source/portable/GCC/MicroBlazeV9/ \
251             -I FreeRTOS/Source/include \
252             -I FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src \
253             -I FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/BSP/microblaze_0/libsrc/standalone_v5_4/src \
254             -I FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/BSP/microblaze_0/include \
255             -I FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/BSP/microblaze_0/libsrc/intc_v3_5/src
256           echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
257
258
259   ARM-GCC:
260     name: GNU ARM Toolchain
261     runs-on: ubuntu-latest
262     steps:
263       - name: Checkout the FreeRTOS/FreeRTOS Repository
264         uses: actions/checkout@v4.1.1
265         with:
266           ref: main
267           repository: FreeRTOS/FreeRTOS
268           fetch-depth: 1
269
270       - env:
271           stepName: Fetch Dependencies
272         shell: bash
273         run: |
274           # ${{ env.stepName }}
275           echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
276           git submodule update --checkout --init --depth 1 FreeRTOS/Demo/ThirdParty/Community-Supported-Demos FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace
277           echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
278
279       # Checkout user pull request changes
280       - name: Checkout Pull Request
281         uses: actions/checkout@v4.1.1
282         with:
283           path: ./FreeRTOS/Source
284
285       - name: Install GNU ARM Toolchain
286         shell: bash
287         run: |
288           sudo apt-get -y update
289           sudo apt-get -y install gcc-arm-none-eabi build-essential cmake git ninja-build python3-minimal
290
291       - name: Build CORTEX_MPU_M3_MPS2_QEMU_GCC Demo
292         shell: bash
293         working-directory: FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC
294         run: make -j
295
296       - name: Build CORTEX_MPU_R4F_TI_RM46_HERCULES_GCC Demo
297         shell: bash
298         working-directory: FreeRTOS/Demo/CORTEX_MPU_R4F_TI_RM46_HERCULES_GCC
299         run: cmake -S . -B build && make -j -C build all
300
301       - name: Build CORTEX_MPU_R5F_TI_RM57_HERCULES_GCC Demo
302         shell: bash
303         working-directory: FreeRTOS/Demo/CORTEX_MPU_R5F_TI_RM57_HERCULES_GCC
304         run: cmake -S . -B build && make -j -C build all
305
306       - name: Build CORTEX_LM3S102_GCC Demo
307         shell: bash
308         working-directory: FreeRTOS/Demo/CORTEX_LM3S102_GCC
309         run: make -j
310
311       - name: Build CORTEX_LM3S811_GCC Demo
312         shell: bash
313         working-directory: FreeRTOS/Demo/CORTEX_LM3S811_GCC
314         run: make -j
315
316       - name: Build CORTEX_M0+_RP2040 Demos
317         shell: bash
318         working-directory: FreeRTOS/Demo/ThirdParty/Community-Supported-Demos/CORTEX_M0+_RP2040
319         run: |
320           git clone https://github.com/raspberrypi/pico-sdk.git
321           cmake -B build -DPICO_SDK_PATH=pico-sdk -GNinja
322           ninja -C build --verbose
323
324       - name: Build CORTEX_MPS2_QEMU_IAR_GCC Demo
325         shell: bash
326         working-directory: FreeRTOS/Demo/CORTEX_MPS2_QEMU_IAR_GCC
327         run: make -C build/gcc -j