Skip to content

Extend coi documentation #68

Extend coi documentation

Extend coi documentation #68

name: 02-Build-Firmware
on:
pull_request_target:
types: [opened, synchronize, edited]
env:
ARCH: x86_64
POST_BUILD_EXE: "/opt/commander-cli/commander-cli"
ARM_GCC_DIR: "/opt/gcc-arm-none-eabi/"
ARM_GCC_URL: "https://developer.arm.com/-/media/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz"
jobs:
FW_build:
runs-on: ubuntu-latest
steps:
- name: Checkout fork repo
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.user.login }}/${{ github.event.repository.name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Check the change
id: check_change
run: |
git remote add upstream https://github.com/SiliconLabsSoftware/community-creations.git
git fetch upstream
git diff --name-only upstream/main HEAD > git_log.txt
grep -v "scripts\\|.github\\|.gitmodules" git_log.txt > git_diff.txt
xargs -I{} -a git_diff.txt find {} -type f -name "*.[ch]" > source_list.txt
xargs -I{} -a git_diff.txt find {} -type f -name "*.slcp" > solution_list.txt
if ! [ -s source_list.txt -o -s solution_list.txt ]; then
echo "No project changes detected...........Skipped"
echo "has_changes=false" >> $GITHUB_OUTPUT
exit 0
fi
echo "has_changes=true" >> $GITHUB_OUTPUT
# For debug
cat solution_list.txt
- name: Install Dependencies
if: ${{ steps.check_change.outputs.has_changes == 'true' }}
run: |
sudo apt-get update && \
sudo apt-get install --no-install-recommends -y \
clang \
clang-tidy \
cppcheck \
git \
build-essential \
curl \
jq \
python3-dev \
python3-pip \
ninja-build \
make \
wget \
zip \
unzip \
libgl1 \
libglib2.0-0 \
libpcre2-dev
- name: CMake 3.25.4
if: ${{ steps.check_change.outputs.has_changes == 'true' }}
run: |
wget https://github.com/Kitware/CMake/releases/download/v3.25.3/cmake-3.25.3-linux-${{ env.ARCH }}.sh \
-q -O /tmp/cmake-install.sh \
&& chmod u+x /tmp/cmake-install.sh \
&& mkdir /opt/cmake-3.25.3 \
&& /tmp/cmake-install.sh --skip-license --prefix=/opt/cmake-3.25.3 \
&& rm /tmp/cmake-install.sh \
&& ln -sf /opt/cmake-3.25.3/bin/* /usr/local/bin
- name: Install GNU Arm Embedded Toolchain
if: ${{ steps.check_change.outputs.has_changes == 'true' }}
run: |
cd /tmp/ \
&& wget ${{ env.ARM_GCC_URL }} \
&& tar -xf arm-gnu-toolchain-12.2.rel1-${{ env.ARCH }}-arm-none-eabi.tar.xz \
&& mv arm-gnu-toolchain-12.2.rel1-${{ env.ARCH }}-arm-none-eabi /opt/gcc-arm-none-eabi \
&& rm arm-gnu-toolchain-12.2.rel-${{ env.ARCH }}-arm-none-eabi -rf
- name: Simplicity Commander
if: ${{ steps.check_change.outputs.has_changes == 'true' }}
run: |
wget https://www.silabs.com/documents/login/software/SimplicityCommander-Linux.zip \
&& unzip SimplicityCommander-Linux.zip \
&& tar -xf SimplicityCommander-Linux/Commander-cli_linux_${{ env.ARCH }}_*.tar.bz \
&& mv commander-cli /opt/commander-cli \
&& rm -rf SimplicityCommander-Linux.zip SimplicityCommander-Linux
- name: Build the project
if: ${{ steps.check_change.outputs.has_changes == 'true' }}
run: |
python3 scripts/pre_build.py
cat ./Makefile
echo ==============================
cd ${{ github.workspace}} \
&& make all