1name: FreeRTOS-Kernel Demos
2on: [push, pull_request]
3
4env:
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
11jobs:
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      - name: Install MSP430 Toolchain
154        shell: bash
155        run: |
156          sudo apt-get -y update
157          sudo apt-get -y install gcc-msp430 build-essential
158
159      - name: Build msp430_GCC Demo
160        shell: bash
161        working-directory: FreeRTOS/Demo/msp430_GCC
162        run: make -j
163
164  MicroBlaze-GCC:
165    name: GCC MicroBlaze Toolchain
166    runs-on: ubuntu-latest
167    steps:
168      - name: Checkout the FreeRTOS/FreeRTOS Repository
169        uses: actions/checkout@v4.1.1
170        with:
171          ref: main
172          repository: FreeRTOS/FreeRTOS
173          fetch-depth: 1
174
175      - env:
176          stepName: Fetch Community-Supported-Demos Submodule
177        shell: bash
178        run: |
179          # ${{ env.stepName }}
180          echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
181          git submodule update --checkout --init --depth 1 FreeRTOS/Demo/ThirdParty/Community-Supported-Demos
182          # This repository contains the microblaze_instructions.h header file
183          git clone https://github.com/Xilinx/embeddedsw.git --branch xilinx_v2023.1
184          echo "::endgroup::"
185          echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
186
187      # Checkout user pull request changes
188      - name: Checkout Pull Request
189        uses: actions/checkout@v4.1.1
190        with:
191          path: ./FreeRTOS/Source
192
193      - env:
194          stepName: Install Dependancies
195        shell: bash
196        run: |
197          # ${{ env.stepName }}
198          echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
199          sudo apt update -y
200          sudo apt upgrade -y
201          sudo apt install -y build-essential m4 debhelper bison texinfo dejagnu flex
202          sudo apt install -y autogen gawk libgmp-dev libmpc-dev libmpfr-dev
203          sudo apt install -y patchutils sharutils zlib1g-dev autoconf2.64
204
205          # Download the mb-gcc toolchain from github
206          curl -L -O https://github.com/mdednev/mb-gcc/releases/download/2021-0623%2B2/binutils-microblaze_2.35-2021-0623+1_amd64.deb;
207          curl -L -O https://github.com/mdednev/mb-gcc/releases/download/2021-0623%2B2/gcc-microblaze_10.2.0-2021-0623+2_amd64.deb;
208          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;
209          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;
210          curl -L -O https://github.com/mdednev/mb-gcc/releases/download/2021-0623%2B2/libnewlib-microblaze_3.3.0-2021-0623+3_all.deb;
211          curl -L -O https://github.com/mdednev/mb-gcc/releases/download/2021-0623%2B2/newlib-source_3.3.0-2021-0623+3_all.deb;
212
213          # Install the packages for the toolchain
214          sudo apt install -y ./binutils-microblaze*.deb;
215          sudo apt install -y ./gcc-microblaze*.deb;
216          sudo apt install -y ./libnewlib-microblaze-dev*.deb;
217          sudo apt install -y ./libnewlib-microblaze-doc*.deb;
218          sudo apt install -y ./libnewlib-microblaze*.deb;
219          sudo apt install -y ./newlib-source*.deb;
220
221          # Validate that the toolchain is in the path and can be called
222          which mb-gcc
223          mb-gcc --version
224
225          echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
226
227      - env:
228          stepName: Compile Microblaze Port
229        shell: bash
230        run: |
231          # ${{ env.stepName }}
232          echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
233          # Compile MicroBlazeV9 Port files to validate they build
234          mb-gcc -mcpu=v9.5 -c \
235            FreeRTOS/Source/portable/GCC/MicroBlazeV9/port.c \
236            FreeRTOS/Source/portable/GCC/MicroBlazeV9/portasm.S \
237            FreeRTOS/Source/portable/GCC/MicroBlazeV9/port_exceptions.c \
238            FreeRTOS/Source/tasks.c \
239            FreeRTOS/Source/list.c \
240            -I embeddedsw/lib/bsp/standalone/src/microblaze \
241            -I FreeRTOS/Source/portable/GCC/MicroBlazeV9/ \
242            -I FreeRTOS/Source/include \
243            -I FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src \
244            -I FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/BSP/microblaze_0/libsrc/standalone_v5_4/src \
245            -I FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/BSP/microblaze_0/include \
246            -I FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/BSP/microblaze_0/libsrc/intc_v3_5/src
247          echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
248
249
250  ARM-GCC:
251    name: GNU ARM Toolchain
252    runs-on: ubuntu-latest
253    steps:
254      - name: Checkout the FreeRTOS/FreeRTOS Repository
255        uses: actions/checkout@v4.1.1
256        with:
257          ref: main
258          repository: FreeRTOS/FreeRTOS
259          fetch-depth: 1
260
261      - env:
262          stepName: Fetch Community-Supported-Demos Submodule
263        shell: bash
264        run: |
265          # ${{ env.stepName }}
266          echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
267          git submodule update --checkout --init --depth 1 FreeRTOS/Demo/ThirdParty/Community-Supported-Demos
268          echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
269
270      # Checkout user pull request changes
271      - name: Checkout Pull Request
272        uses: actions/checkout@v4.1.1
273        with:
274          path: ./FreeRTOS/Source
275
276      - name: Install GNU ARM Toolchain
277        shell: bash
278        run: |
279          sudo apt-get -y update
280          sudo apt-get -y install gcc-arm-none-eabi build-essential cmake git ninja-build python3-minimal
281
282      - name: Build CORTEX_MPU_M3_MPS2_QEMU_GCC Demo
283        shell: bash
284        working-directory: FreeRTOS/Demo/CORTEX_MPU_M3_MPS2_QEMU_GCC
285        run: make -j
286
287      - name: Build CORTEX_MPU_R4F_TI_RM46_HERCULES_GCC Demo
288        shell: bash
289        working-directory: FreeRTOS/Demo/CORTEX_MPU_R4F_TI_RM46_HERCULES_GCC
290        run: cmake -S . -B build && make -j -C build all
291
292      - name: Build CORTEX_MPU_R5F_TI_RM57_HERCULES_GCC Demo
293        shell: bash
294        working-directory: FreeRTOS/Demo/CORTEX_MPU_R5F_TI_RM57_HERCULES_GCC
295        run: cmake -S . -B build && make -j -C build all
296
297      - name: Build CORTEX_LM3S102_GCC Demo
298        shell: bash
299        working-directory: FreeRTOS/Demo/CORTEX_LM3S102_GCC
300        run: make -j
301
302      - name: Build CORTEX_LM3S811_GCC Demo
303        shell: bash
304        working-directory: FreeRTOS/Demo/CORTEX_LM3S811_GCC
305        run: make -j
306
307      - name: Build CORTEX_M0+_RP2040 Demos
308        shell: bash
309        working-directory: FreeRTOS/Demo/ThirdParty/Community-Supported-Demos/CORTEX_M0+_RP2040
310        run: |
311          git clone https://github.com/raspberrypi/pico-sdk.git
312          cmake -B build -DPICO_SDK_PATH=pico-sdk -GNinja
313          ninja -C build --verbose
314
315      - name: Build CORTEX_MPS2_QEMU_IAR_GCC Demo
316        shell: bash
317        working-directory: FreeRTOS/Demo/CORTEX_MPS2_QEMU_IAR_GCC
318        run: make -C build/gcc -j
319