Merge pull request #97 from TexasInstruments/a0510353_example_fir #54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Makefile CI | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ "**" ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build and Validate | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Show tool versions | |
| run: | | |
| python3 --version || true | |
| make --version | |
| - name: Install OS dependencies | |
| run: | | |
| sudo tee -a /etc/apt/sources.list >/dev/null <<'EOF' | |
| deb http://security.ubuntu.com/ubuntu focal-security main universe | |
| EOF | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| libx11-6 libxext6 libxrender1 libxtst6 libxi6 libxt6 libxinerama1 \ | |
| libgtk2.0-0 libncurses5 libnss3 python3-pip \ | |
| unzip xz-utils wget ca-certificates | |
| pip3 install pyserial xmodem tqdm pyelftools construct | |
| - name: Restore toolchain/SDK cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| $HOME/ti | |
| key: toolchain-mcu-sdk-${{ runner.os }}-v1-ccs20_3_1-pru2_3_3-am243x_11_01_00_17-am261x_10_02_00_15-am263px_11_00_00_19 | |
| - name: Install MCU+ SDKs, CCS, SYSCONFIG, TIARMCLANG and PRU CGT if missing | |
| run: | | |
| set -e | |
| mkdir -p "$HOME/ti/downloads" | |
| cd "$HOME/ti" | |
| # Install CCS 20.3.1 | |
| if [ ! -d "$HOME/ti/ccs_10.3.1" ]; then | |
| cd "$HOME/ti/downloads" | |
| wget -q --retry-connrefused --waitretry=1 --tries=5 --timeout=30 \ | |
| https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-J1VdearkvK/20.3.1/CCS_20.3.1.00005_linux.zip | |
| cd "$HOME/ti" | |
| unzip -q "$HOME/ti/downloads/CCS_20.3.1.00005_linux.zip" | |
| cd CCS_20.3.1.00005_linux | |
| ./ccs_setup_20.3.1.00005.run --mode unattended --prefix "$HOME/ti/ccs_10.3.1" | |
| fi | |
| #install SYSCONFIG 1.23 | |
| if [ ! -d "$HOME/ti/ccs_10.3.1/ccs/utils/sysconfig_1.23.1" ] && [ ! -d "$HOME/ti/sysconfig_1.23.1" ]; then | |
| cd "$HOME/ti/downloads" | |
| wget -q --retry-connrefused --waitretry=1 --tries=5 --timeout=30 \ | |
| https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.23.1.4034/sysconfig-1.23.1_4034-setup.run | |
| chmod +x sysconfig-1.23.1_4034-setup.run | |
| ./sysconfig-1.23.1_4034-setup.run --mode unattended --prefix "$HOME/ti/sysconfig_1.23.1" | |
| chmod -R +x $HOME/ti/sysconfig_1.23.1 | |
| fi | |
| #Install ARM CLANG CGT 4.0.3 | |
| if [ ! -d "$HOME/ti/ccs_10.3.1/ccs/tools/compiler/ti-cgt-armllvm_4.0.3.LTS" ] && [ ! -d "$HOME/ti/ti-cgt-armllvm_4.0.3.LTS" ]; then | |
| cd "$HOME/ti/downloads" | |
| wget -q --retry-connrefused --waitretry=1 --tries=5 --timeout=30 \ | |
| https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-ayxs93eZNN/4.0.3.LTS/ti_cgt_armllvm_4.0.3.LTS_linux-x64_installer.bin | |
| chmod +x ti_cgt_armllvm_4.0.3.LTS_linux-x64_installer.bin | |
| ./ti_cgt_armllvm_4.0.3.LTS_linux-x64_installer.bin --mode unattended --prefix "$HOME/ti/" | |
| fi | |
| # Install PRU CGT 2.3.3 | |
| if [ ! -d "$HOME/ti/ccs_10.3.1/ccs/tools/compiler/ti-cgt-pru_2.3.3" ] && [ ! -d "$HOME/ti/ti-cgt-pru_2.3.3" ]; then | |
| cd "$HOME/ti/downloads" | |
| wget -q --retry-connrefused --waitretry=1 --tries=5 --timeout=30 \ | |
| https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-FaNNGkDH7s/2.3.3/ti_cgt_pru_2.3.3_linux_installer_x86.bin | |
| chmod +x ti_cgt_pru_2.3.3_linux_installer_x86.bin | |
| ./ti_cgt_pru_2.3.3_linux_installer_x86.bin --mode unattended --prefix "$HOME/ti" | |
| fi | |
| # Install MCU+ SDK AM243x 11.00.00.15 | |
| if [ ! -d "$HOME/ti/mcu_plus_sdk_am243x_11_00_00_15" ]; then | |
| cd "$HOME/ti/downloads" | |
| wget -q --retry-connrefused --waitretry=1 --tries=5 --timeout=30 \ | |
| https://dr-download.ti.com/software-development/software-development-kit-sdk/MD-ouHbHEm1PK/11.00.00.15/mcu_plus_sdk_am243x_11_00_00_15-linux-x64-installer.run | |
| chmod +x mcu_plus_sdk_am243x_11_00_00_15-linux-x64-installer.run | |
| ./mcu_plus_sdk_am243x_11_00_00_15-linux-x64-installer.run --mode unattended --prefix "$HOME/ti/" | |
| fi | |
| # Install MCU+ SDK AM261x 10.02.00.15 | |
| if [ ! -d "$HOME/ti/mcu_plus_sdk_am261x_10_02_00_15" ]; then | |
| cd "$HOME/ti/downloads" | |
| wget -q --retry-connrefused --waitretry=1 --tries=5 --timeout=30 \ | |
| https://dr-download.ti.com/software-development/software-development-kit-sdk/MD-h64OlWnQrg/10.02.00.15/mcu_plus_sdk_am261x_10_02_00_15-linux-x64-installer.run | |
| chmod +x mcu_plus_sdk_am261x_10_02_00_15-linux-x64-installer.run | |
| ./mcu_plus_sdk_am261x_10_02_00_15-linux-x64-installer.run --mode unattended --prefix "$HOME/ti/" | |
| fi | |
| # Install MCU+ SDK AM263Px 10.02.00.15 | |
| if [ ! -d "$HOME/ti/mcu_plus_sdk_am263px_10_02_00_15" ]; then | |
| cd "$HOME/ti/downloads" | |
| wget -q --retry-connrefused --waitretry=1 --tries=5 --timeout=30 \ | |
| https://dr-download.ti.com/software-development/software-development-kit-sdk/MD-JVtW1V4WfA/10.02.00.15/mcu_plus_sdk_am263px_10_02_00_15-linux-x64-installer.run | |
| chmod +x mcu_plus_sdk_am263px_10_02_00_15-linux-x64-installer.run | |
| ./mcu_plus_sdk_am263px_10_02_00_15-linux-x64-installer.run --mode unattended --prefix "$HOME/ti/" | |
| fi | |
| #ls -l "$HOME/ti/" | |
| #ls -l "$HOME/ti/downloads" | |
| #ls -l "$HOME/ti/ccs_10.3.1/ccs/tools/compiler" | |
| #ls -l "$HOME/ti/sysconfig_1.23.1" | |
| #ls -lR "$HOME/ti/ti-cgt-armllvm_4.0.3.LTS" | |
| test -x "$HOME/ti/ti-cgt-armllvm_4.0.3.LTS/bin/tiarmclang" && "$HOME/ti/ti-cgt-armllvm_4.0.3.LTS/bin/tiarmclang" --version || ls -l "$HOME/ti/ti-cgt-armllvm_4.0.3.LTS" | |
| - name: Export toolchain environment | |
| run: | | |
| { | |
| echo "CCS_PATH=$HOME/ti/ccs_10.3.1" | |
| if [ -d "$HOME/ti/ccs_10.3.1/ccs/tools/compiler/ti-cgt-pru_2.3.3" ]; then | |
| echo "CGT_TI_PRU_PATH=$HOME/ti/ccs_10.3.1/ccs/tools/compiler/ti-cgt-pru_2.3.3" | |
| else | |
| echo "CGT_TI_PRU_PATH=$HOME/ti/ti-cgt-pru_2.3.3" | |
| fi | |
| echo "CGT_TI_ARM_CLANG_PATH=$HOME/ti/ti-cgt-armllvm_4.0.3.LTS" | |
| echo "MCU_PLUS_SDK_PATH_AM243X=$HOME/ti/mcu_plus_sdk_am243x_11_00_00_15" | |
| echo "MCU_PLUS_SDK_PATH_AM261X=$HOME/ti/mcu_plus_sdk_am261x_10_02_00_15" | |
| echo "MCU_PLUS_SDK_PATH_AM263PX=$HOME/ti/mcu_plus_sdk_am263px_10_02_00_15" | |
| echo "PATH=$PATH:$HOME/ti/ccs_10.3.1/ccs/eclipse:$HOME/ti/ccs_10.3.1/ccs/utils/bin:$CGT_TI_PRU_PATH/bin" | |
| } >> $GITHUB_ENV | |
| - name: Generate imports.mak for CI | |
| run: | | |
| cat > imports.mak <<'EOF' | |
| # Auto-generated by CI | |
| DEVICE ?= am243x am261x am263px | |
| PROFILE?=release | |
| DEVICE_TYPE?=GP | |
| BUILD_MCUPLUS?=y | |
| BUILD_LINUX?=n | |
| # SDK roots | |
| MCU_PLUS_SDK_PATH_AM243X := $(HOME)/ti/mcu_plus_sdk_am243x_11_00_00_15 | |
| MCU_PLUS_SDK_PATH_AM261X := $(HOME)/ti/mcu_plus_sdk_am261x_10_02_00_15 | |
| MCU_PLUS_SDK_PATH_AM263PX := $(HOME)/ti/mcu_plus_sdk_am263px_10_02_00_15 | |
| # Toolchains | |
| CCS_PATH := $(HOME)/ti/ccs_10.3.1 | |
| # Prefer CGT inside CCS if present, otherwise standalone | |
| ifneq ($(wildcard $(CCS_PATH)/ccs/tools/compiler/ti-cgt-pru_2.3.3),) | |
| CGT_TI_PRU_PATH := $(CCS_PATH)/ccs/tools/compiler/ti-cgt-pru_2.3.3 | |
| else | |
| CGT_TI_PRU_PATH := $(HOME)/ti/ti-cgt-pru_2.3.3 | |
| endif | |
| CGT_TI_ARM_CLANG_PATH=$(CCS_PATH)/ccs/tools/compiler/ti-cgt-armllvm_4.0.3.LTS | |
| ifeq ($(wildcard $(CGT_TI_ARM_CLANG_PATH)),) | |
| CGT_TI_ARM_CLANG_PATH= $(HOME)/ti/ti-cgt-armllvm_4.0.3.LTS | |
| endif | |
| SYSCFG_PATH ?= $(HOME)/ti/sysconfig_1.23.1 | |
| # Other variables | |
| # you probably will not need to edit these values | |
| OPEN_PRU_PATH ?= $(abspath .) | |
| # Exported for sub-makes that rely on environment | |
| export MCU_PLUS_SDK_PATH_AM243X | |
| export MCU_PLUS_SDK_PATH_AM261X | |
| export MCU_PLUS_SDK_PATH_AM263PX | |
| export CCS_PATH | |
| export CGT_TI_PRU_PATH | |
| export CGT_TI_ARM_CLANG_PATH | |
| export SYSCFG_PATH | |
| export CCS_ECLIPSE=$(CCS_PATH)/ccs/eclipse | |
| export MKDIR=mkdir -p | |
| export RMDIR=rm -rf | |
| export RM=rm -f | |
| export COPY=cp | |
| export MOVE=mv | |
| export CAT=cat | |
| export SED=sed | |
| export TOUCH=touch | |
| export PATHSEP=/ | |
| export CHMOD=chmod | |
| CCS_NODE = $(CCS_PATH)/ccs/tools/node/node | |
| SYSCFG_CLI_PATH ?= $(SYSCFG_PATH) | |
| SYSCFG_NODE = $(SYSCFG_PATH)/nodejs/node | |
| SYSCFG_NWJS = $(SYSCFG_PATH)/nw/nw | |
| SYSCFG_SDKPRODUCT=$(MCU_PLUS_SDK_PATH)/.metadata/product.json | |
| SYSCFG_MCU_PLUS_SDK_PRODUCT=$(OPEN_PRU_PATH)/.metadata/product.json | |
| EOF | |
| echo "Generated imports.mak:" && sed -n '1,120p' imports.mak | |
| - name: Build all via top-level makefile | |
| run: | | |
| make -j$(nproc) MCU_PLUS_SDK_PATH=$MCU_PLUS_SDK_PATH_AM243X DEVICE=am243x | |
| make -j$(nproc) MCU_PLUS_SDK_PATH=$MCU_PLUS_SDK_PATH_AM261X DEVICE=am261x | |
| make -j$(nproc) MCU_PLUS_SDK_PATH=$MCU_PLUS_SDK_PATH_AM263PX DEVICE=am263px | |
| - name: Build academy (best-effort) | |
| run: | | |
| make -C academy -j$(nproc) MCU_PLUS_SDK_PATH=$MCU_PLUS_SDK_PATH_AM243X DEVICE=am243x | |
| make -C academy -j$(nproc) MCU_PLUS_SDK_PATH=$MCU_PLUS_SDK_PATH_AM261X DEVICE=am261x | |
| make -C academy -j$(nproc) MCU_PLUS_SDK_PATH=$MCU_PLUS_SDK_PATH_AM263PX DEVICE=am263px | |
| - name: Build examples folder | |
| run: | | |
| make -C examples -j$(nproc) MCU_PLUS_SDK_PATH=$MCU_PLUS_SDK_PATH_AM243X DEVICE=am243x | |
| make -C examples -j$(nproc) MCU_PLUS_SDK_PATH=$MCU_PLUS_SDK_PATH_AM261X DEVICE=am261x | |
| make -C examples -j$(nproc) MCU_PLUS_SDK_PATH=$MCU_PLUS_SDK_PATH_AM263PX DEVICE=am263px | |
| - name: Upload build artifacts | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-artifacts | |
| path: | | |
| **/build/** | |
| **/out/** | |
| **/*.out | |
| **/*.bin | |
| if-no-files-found: ignore | |
| #formatting: | |
| #name: Static formatting checks | |
| #runs-on: ubuntu-latest | |
| #steps: | |
| #- name: Checkout repository | |
| # uses: actions/checkout@v4 | |
| #- name: Enforce newline and EOL policy | |
| # run: | | |
| # Fail if any file contains no CRLF or tabs or lines > 129 chars | |
| # ! git ls-files -z | while IFS= read -r -d '' f; do | |
| # if file -b --mime-type "$f" | grep -q '^text/'; then | |
| # if ! grep -q $'\r' -- "$f"; then | |
| # printf '%s\n' "$f" | |
| # fi | |
| # fi | |
| # done | |
| #! git grep -Il \t' | xargs -r -I{} bash -c 'echo "Tab character found in {}"; exit 1' | |
| #! git grep -InE '.{130,}' -- ':!*.png' ':!*.jpg' ':!*.gif' ':!*.bin' ':!*.out' && true | |
| #- name: Verify no stray TODO, prefer FIXME | |
| # run: | | |
| # if git grep -In "TODO" -- ':!**/third_party/**' ':!**/*.md' ; then | |
| # echo "Found TODO markers. Use FIXME as per repository rules."; | |
| # exit 1; | |
| # fi | |
| # shell: bash |