From 47d37354bc19e182928c1d8be27bbfc9efe32b52 Mon Sep 17 00:00:00 2001 From: alfred gedeon <28123637+alfred2g@users.noreply.github.com> Date: Tue, 12 Jan 2021 20:13:29 -0800 Subject: [PATCH] Add Posix build checker to git actions (#489) * Add Posix build checker to git actions * fix checker path * Fix script, checkout recursively * fix build check script return value * clone submodules as well with posix checker * Add quotes to true for submodules * Fix Submodules * Remove pcap dependency from Makefile * install libpcap for build check * Add networking build to posix * Separate network build from normal build * add libpcap after building normal posix --- .github/scripts/posix_build_checker.sh | 24 +++++++++++++++++++ .../scripts/posix_network_build_checker.sh | 24 +++++++++++++++++++ .github/workflows/core-checks.yml | 19 +++++++++++++++ FreeRTOS/Demo/Posix_GCC/Makefile | 2 +- 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 .github/scripts/posix_build_checker.sh create mode 100644 .github/scripts/posix_network_build_checker.sh diff --git a/.github/scripts/posix_build_checker.sh b/.github/scripts/posix_build_checker.sh new file mode 100644 index 000000000..f23070a5d --- /dev/null +++ b/.github/scripts/posix_build_checker.sh @@ -0,0 +1,24 @@ +PROJECT=$1 +echo "Verifying url links of: ${PROJECT}" +if [ ! -d "$PROJECT" ] +then + echo "Directory passed does not exist" + exit 2 +fi + +SCRIPT_RET=0 + +set -o nounset # Treat unset variables as an error + +cd ${PROJECT}/FreeRTOS/Demo/Posix_GCC +make + +SCRIPT_RET=$? + +if [ "${SCRIPT_RET}" -eq 0 ] +then + exit 0 +else + exit 1 +fi + diff --git a/.github/scripts/posix_network_build_checker.sh b/.github/scripts/posix_network_build_checker.sh new file mode 100644 index 000000000..457fdc93f --- /dev/null +++ b/.github/scripts/posix_network_build_checker.sh @@ -0,0 +1,24 @@ + +PROJECT=$1 +echo "Verifying url links of: ${PROJECT}" +if [ ! -d "$PROJECT" ] +then + echo "Directory passed does not exist" + exit 2 +fi + +SCRIPT_RET=0 + +set -o nounset # Treat unset variables as an error + +cd ${PROJECT}/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Echo_Posix +make + +SCRIPT_RET=$? + +if [ "${SCRIPT_RET}" -eq 0 ] +then + exit 0 +else + exit 1 +fi diff --git a/.github/workflows/core-checks.yml b/.github/workflows/core-checks.yml index 1460c8d29..1eca34837 100644 --- a/.github/workflows/core-checks.yml +++ b/.github/workflows/core-checks.yml @@ -43,4 +43,23 @@ jobs: export PYTHONPATH=tools/.github/scripts:${PYTHONPATH} .github/scripts/core_checker.py --json ${HOME}/files_modified.json ${HOME}/files_added.json ${HOME}/files_renamed.json exit $? + build-checker: + name: FreeRTOS Posix Build Check + runs-on: ubuntu-latest + steps: + - name: Clone This Repo + uses: actions/checkout@v2 + with: + path: ./workspace + submodules: 'recursive' + fetch-depth: 1 + - name: Posix Build Checker + run: | + bash workspace/.github/scripts/posix_build_checker.sh workspace + - name: Install lib pcap dev + run: | + sudo apt-get install libpcap-dev + - name: Posix Network Build Checker + run: | + bash workspace/.github/scripts/posix_network_build_checker.sh workspace diff --git a/FreeRTOS/Demo/Posix_GCC/Makefile b/FreeRTOS/Demo/Posix_GCC/Makefile index 86755f2a5..993fa5ad0 100644 --- a/FreeRTOS/Demo/Posix_GCC/Makefile +++ b/FreeRTOS/Demo/Posix_GCC/Makefile @@ -59,7 +59,7 @@ SOURCE_FILES += ${FREERTOS_PLUS_DIR}/Source/FreeRTOS-Plus-Trace/streamports/File CFLAGS := -ggdb3 -O0 -DprojCOVERAGE_TEST=0 -D_WINDOWS_ -LDFLAGS := -ggdb3 -O0 -pthread -lpcap +LDFLAGS := -ggdb3 -O0 -pthread OBJ_FILES = $(SOURCE_FILES:%.c=$(BUILD_DIR)/%.o)