mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-12-07 13:45:00 -05:00
Create GitHub Workflows that execute the p3 FreeRTOS Kernel Demos (#1018)
* test full demo * Revert "test full demo" This reverts commit 09efa00ec0a3f021f190112fa11bc0f4c6c058bb. revert back to origin * pre-define user demo to blinky demo * pre-define user demo to blinky demo with -j * test run win32-msvc demo * test run win32-msvc demo * test run win32-msvc demo * update git workflow to run WIN32-MSVC demo * update git workflow to run WIN32-MSVC demo * update git workflow to run WIN32-MSVC demo * update git workflow to run WIN32-MSVC demo * update git workflow to run WIN32-MSVC demo * update git workflow to run WIN32-MSVC demo * update git workflow to run WIN32-MSVC demo * update trigger action * build and run WIN32-MSVC blinky demo * build and run WIN32-MSVC blinky demo * build and run WIN32-MSVC blinky demo * update WIN32-MSVC workflow * update WIN32-MSVC Demo main.c file to remove buffer * Update main.c files to remove buffer when running executable_monitor file for Git Action * update formatting for WIN32-MSVC demos * update formatting for Posix demo * update comment for setvbuf function used in main.c * add git build and run action for WIN32-MingW Full and Blinky demos; update main.c file to set buffer size as 0 * add git build and run action for WIN32-MingW Full and Blinky demos; update main.c file to set buffer size as 0 * remove whitespace for freertos_demos.yml file * add function to Force stdout to write immediately by setting the buffer size for it to 0 in demo main.c file when running git Run Action; Correct formatting error for WIN32-MingW main.c file * add function to Force stdout to write immediately by setting the buffer size for it to 0 in demo main.c file when running git Run Action * update git run action commands for Posix_GCC demo * update git run action commands for Posix_GCC demo * update git run action commands for Posix_GCC demo * reduce timeout and correct formatting issue * reduce timeout --------- Co-authored-by: Xiaodong Li <xiaodonn@amazon.com>
This commit is contained in:
parent
d60b34c8e2
commit
9ccae851e7
5 changed files with 478 additions and 375 deletions
128
.github/workflows/freertos_demos.yml
vendored
128
.github/workflows/freertos_demos.yml
vendored
|
|
@ -2,6 +2,7 @@ name: FreeRTOS Demos
|
|||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
WIN32-MSVC:
|
||||
|
|
@ -19,13 +20,60 @@ jobs:
|
|||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v1.1
|
||||
|
||||
- name: Build WIN32-MSVC Demo
|
||||
- name: Build WIN32-MSVC Full Demo
|
||||
id: build-win32-msvs-full-demo
|
||||
working-directory: FreeRTOS/Demo/WIN32-MSVC
|
||||
run: msbuild WIN32.sln -t:rebuild
|
||||
run: |
|
||||
$content = Get-Content -Path 'main.c' -Raw
|
||||
$newContent = $content -replace 'int\s+main(.*?)void(.*?)\r?\n\s*{', 'int main( void ){setvbuf( stdout, NULL, _IONBF, 0 );'
|
||||
$newContent | Set-Content -Path 'main.c'
|
||||
msbuild WIN32.sln -t:rebuild
|
||||
|
||||
- name: Run and monitor WIN32-MSVC Full Demo
|
||||
if: success() || failure() && steps.build-win32-msvs-full-demo.outcome == 'success'
|
||||
uses: FreeRTOS/CI-CD-GitHub-Actions/executable-monitor@main
|
||||
with:
|
||||
exe-path: FreeRTOS/Demo/WIN32-MSVC/Debug/RTOSDemo.exe
|
||||
log-dir: demo_run_logs
|
||||
timeout-seconds: 60
|
||||
success-line: "No errors - tick count"
|
||||
|
||||
- name: Build WIN32-MSVC Blinky Demo
|
||||
id: build-win32-msvs-blinky-demo
|
||||
working-directory: FreeRTOS/Demo/WIN32-MSVC
|
||||
run: |
|
||||
$content = Get-Content -Path 'main.c' -Raw
|
||||
$newContent = $content -replace '#define\s+mainCREATE_SIMPLE_BLINKY_DEMO_ONLY\s+0', '#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 1'
|
||||
$newContent = $newContent -replace 'int\s+main(.*?)void(.*?)\r?\n\s*{', 'int main( void ){setvbuf( stdout, NULL, _IONBF, 0 );'
|
||||
$newContent | Set-Content -Path 'main.c'
|
||||
msbuild WIN32.sln -t:rebuild
|
||||
|
||||
- name: Run and monitor WIN32-MSVC Blinky Demo
|
||||
if: success() || failure() && steps.build-win32-msvs-blinky-demo.outcome == 'success'
|
||||
uses: FreeRTOS/CI-CD-GitHub-Actions/executable-monitor@main
|
||||
with:
|
||||
exe-path: FreeRTOS/Demo/WIN32-MSVC/Debug/RTOSDemo.exe
|
||||
log-dir: demo_run_logs
|
||||
timeout-seconds: 60
|
||||
success-line: "Message received from software timer"
|
||||
|
||||
- name: Build WIN32-MSVC-Static-Allocation-Only Demo
|
||||
id: build-win32-msvs-static-allocation-only-demo
|
||||
working-directory: FreeRTOS/Demo/WIN32-MSVC-Static-Allocation-Only
|
||||
run: msbuild WIN32.sln -t:rebuild
|
||||
run: |
|
||||
$content = Get-Content -Path 'main.c' -Raw
|
||||
$newContent = $content -replace 'int\s+main(.*?)void(.*?)\r?\n\s*{', 'int main( void ){setvbuf( stdout, NULL, _IONBF, 0 );'
|
||||
$newContent | Set-Content -Path 'main.c'
|
||||
msbuild WIN32.sln -t:rebuild
|
||||
|
||||
- name: Run and monitor WIN32-MSVC-Static-Allocation-Only Demo
|
||||
if: success() || failure() && steps.build-win32-msvs-static-allocation-only-demo.outcome == 'success'
|
||||
uses: FreeRTOS/CI-CD-GitHub-Actions/executable-monitor@main
|
||||
with:
|
||||
exe-path: FreeRTOS/Demo/WIN32-MSVC-Static-Allocation-Only/Debug/RTOSDemo.exe
|
||||
log-dir: demo_run_logs
|
||||
timeout-seconds: 60
|
||||
success-line: "No errors - tick count"
|
||||
|
||||
WIN32-MingW:
|
||||
name: WIN32 MingW
|
||||
|
|
@ -44,15 +92,49 @@ jobs:
|
|||
run: |
|
||||
git submodule update --checkout --init --depth 1 FreeRTOS/Source
|
||||
|
||||
- name: Build WIN32-MingW Demo
|
||||
- name: Build WIN32-MingW Full Demo
|
||||
id: build-win32-mingw-full-demo
|
||||
working-directory: FreeRTOS/Demo/WIN32-MingW
|
||||
run: |
|
||||
$content = Get-Content -Path 'main.c' -Raw
|
||||
$newContent = $content -replace 'int\s+main(.*?)void(.*?)\r?\n\s*{', 'int main( void ){setvbuf( stdout, NULL, _IONBF, 0 );'
|
||||
$newContent | Set-Content -Path 'main.c'
|
||||
gcc --version
|
||||
make --version
|
||||
make
|
||||
|
||||
- name: Run and monitor WIN32-MingW Full Demo
|
||||
if: success() || failure() && steps.build-win32-mingw-full-demo.outcome == 'success'
|
||||
uses: FreeRTOS/CI-CD-GitHub-Actions/executable-monitor@main
|
||||
with:
|
||||
exe-path: FreeRTOS/Demo/WIN32-MingW/build/RTOSDemo.exe
|
||||
log-dir: demo_run_logs
|
||||
timeout-seconds: 60
|
||||
success-line: "No errors - tick count"
|
||||
|
||||
- name: Build WIN32-MingW Blinky Demo
|
||||
id: build-win32-mingw-blinky-demo
|
||||
working-directory: FreeRTOS/Demo/WIN32-MingW
|
||||
run: |
|
||||
$content = Get-Content -Path 'main.c' -Raw
|
||||
$newContent = $content -replace '#define\s+mainCREATE_SIMPLE_BLINKY_DEMO_ONLY\s+0', '#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 1'
|
||||
$newContent = $newContent -replace 'int\s+main(.*?)void(.*?)\r?\n\s*{', 'int main( void ){setvbuf( stdout, NULL, _IONBF, 0 );'
|
||||
$newContent | Set-Content -Path 'main.c'
|
||||
gcc --version
|
||||
make --version
|
||||
make
|
||||
|
||||
- name: Run and monitor WIN32-MingW Blinky Demo
|
||||
if: success() || failure() && steps.build-win32-mingw-blinky-demo.outcome == 'success'
|
||||
uses: FreeRTOS/CI-CD-GitHub-Actions/executable-monitor@main
|
||||
with:
|
||||
exe-path: FreeRTOS/Demo/WIN32-MingW/build/RTOSDemo.exe
|
||||
log-dir: demo_run_logs
|
||||
timeout-seconds: 60
|
||||
success-line: "Message received from software timer"
|
||||
|
||||
POSIX-GCC:
|
||||
name: Native GCC
|
||||
name: Posix GCC
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
|
|
@ -73,19 +155,17 @@ jobs:
|
|||
shell: bash
|
||||
working-directory: FreeRTOS/Demo/Posix_GCC
|
||||
run: |
|
||||
sed -i -z "s/int[[:space:]]*main[[:space:]]*([[:space:]]*void[[:space:]]*)\n{/int main( void ){setvbuf( stdout, NULL, _IONBF, 0 );/g" main.c
|
||||
make -j
|
||||
|
||||
- name: Run and monitor Posix_GCC Full Demo
|
||||
if: success() || failure() && steps.build-posix-gcc-full-demo.outcome == 'success'
|
||||
working-directory: FreeRTOS/Demo/Posix_GCC
|
||||
run: |
|
||||
timeout 5m build/posix_demo | tee output.txt
|
||||
if grep -q "OK: No errors" output.txt; then
|
||||
echo -e "\nSUCCESS - Found SUCCESS string in output."
|
||||
else
|
||||
echo -e "\nFAILURE - SUCCESS string not found in output."
|
||||
exit 1
|
||||
fi
|
||||
uses: FreeRTOS/CI-CD-GitHub-Actions/executable-monitor@main
|
||||
with:
|
||||
exe-path: FreeRTOS/Demo/Posix_GCC/build/posix_demo
|
||||
log-dir: demo_run_logs
|
||||
timeout-seconds: 60
|
||||
success-line: "OK: No errors"
|
||||
|
||||
- name: Build Posix_GCC Blinky Demo
|
||||
id: build-posix-gcc-blinky-demo
|
||||
|
|
@ -93,20 +173,18 @@ jobs:
|
|||
shell: bash
|
||||
working-directory: FreeRTOS/Demo/Posix_GCC
|
||||
run: |
|
||||
sed -i "s/#define[[:space:]]\+mainSELECTED_APPLICATION[[:space:]]\+FULL_DEMO/#define mainSELECTED_APPLICATION BLINKY_DEMO/g" main.c
|
||||
make -j
|
||||
sed -i -z "s/int[[:space:]]*main[[:space:]]*([[:space:]]*void[[:space:]]*)\n{/int main( void ){setvbuf( stdout, NULL, _IONBF, 0 );/g" main.c
|
||||
rm -rf build
|
||||
make -j USER_DEMO=BLINKY_DEMO
|
||||
|
||||
- name: Run and monitor Posix_GCC Blinky Demo
|
||||
if: success() || failure() && steps.build-posix-gcc-blinky-demo.outcome == 'success'
|
||||
working-directory: FreeRTOS/Demo/Posix_GCC
|
||||
run: |
|
||||
timeout 30s build/posix_demo | tee output.txt
|
||||
if grep -q "Message received from software timer" output.txt; then
|
||||
echo -e "\nSUCCESS - Found SUCCESS string in output."
|
||||
else
|
||||
echo -e "\nFAILURE - SUCCESS string not found in output."
|
||||
exit 1
|
||||
fi
|
||||
uses: FreeRTOS/CI-CD-GitHub-Actions/executable-monitor@main
|
||||
with:
|
||||
exe-path: FreeRTOS/Demo/Posix_GCC/build/posix_demo
|
||||
log-dir: demo_run_logs
|
||||
timeout-seconds: 60
|
||||
success-line: "Message received from software timer"
|
||||
|
||||
MSP430-GCC:
|
||||
name: GNU MSP430 Toolchain
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue