Skip to content

SDO info

SDO info #84

Workflow file for this run

name: PR build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
BUILD_TYPE: Debug
jobs:
build_x86:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-conan-action
- name: Conan install
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
export conan_profile=linux
elif [ "$RUNNER_OS" == "Windows" ]; then
export conan_profile=windows
else
echo "$RUNNER_OS not supported"
exit 1
fi
echo $pwd
echo ${{github.workspace}}/build
mkdir -p ${{github.workspace}}/build
conan install conan/conanfile_${conan_profile}.txt -of=build/ -pr:b conan/profile_${conan_profile}_x86_64.txt -pr:h conan/profile_${conan_profile}_x86_64.txt --build=missing -s build_type=${{env.BUILD_TYPE}}
shell: bash
- name: Install Gcovr
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt install gcovr
- name: Configure CMake
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
export cmake_generator="Unix Makefiles"
export cmake_coverage="-DCODE_COVERAGE=ON"
elif [ "$RUNNER_OS" == "Windows" ]; then
export cmake_generator="MinGW Makefiles"
export cmake_coverage="-DCODE_COVERAGE=OFF"
else
echo "$RUNNER_OS not supported"
exit 1
fi
cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_UNIT_TESTS=ON -G "${cmake_generator}" ${cmake_coverage}
shell: bash
- name: Build
run: cmake --build build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
make coverage_xml
elif [ "$RUNNER_OS" == "Windows" ]; then
make test
else
echo "$RUNNER_OS not supported"
exit 1
fi
shell: bash
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest'
with:
name: coverage
path: build/coverage_xml.xml
build_NuttX:
runs-on: ubuntu-latest
env:
nuttx_version: 3dc6b4c9bd9624ed259e676f8e9761dbf660c1bb
nuttx_apps_version: nuttx-12.5.0-RC0
arm_none_eabi_version: 13.2.Rel1/binrel/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi
steps:
- name: checkout KickCAT
uses: actions/checkout@v4
with:
path: 'KickCAT'
- name: Cache NuttX
id: cache-nuttx
uses: actions/cache@v4
with:
path: ${{GITHUB.WORKSPACE}}/nuttxspace/nuttx
key: nuttx_${{env.nuttx_version}}
- if: ${{ steps.cache-nuttx.outputs.cache-hit != 'true' }}
name: checkout NuttX
uses: actions/checkout@v4
with:
repository: apache/nuttx
path: 'nuttxspace/nuttx'
ref: '${{env.nuttx_version}}'
- name: Cache NuttX Apps
id: cache-nuttx-apps
uses: actions/cache@v4
with:
path: ${{GITHUB.WORKSPACE}}/nuttxspace/apps
key: nuttx-apps_${{env.nuttx_apps_version}}
- if: ${{ steps.cache-nuttx-apps.outputs.cache-hit != 'true' }}
name: checkout NuttX Apps
uses: actions/checkout@v4
with:
repository: apache/nuttx-apps
path: 'nuttxspace/apps'
ref: '${{env.nuttx_apps_version}}'
- name: apt update
run: sudo apt update
- name: Install Kconfig
run: sudo apt install kconfig-frontends
- name: Cache Arm None Eabi
id: cache-arm-none-eabi
uses: actions/cache@v4
with:
path: ${{GITHUB.WORKSPACE}}/gcc-arm-none-eabi
key: ${{env.arm_none_eabi_version}}
- if: ${{ steps.cache-arm-none-eabi.outputs.cache-hit != 'true' }}
name: Download gcc-arm-none-eabi
run: |
# Download the latest ARM GCC toolchain prebuilt by ARM
mkdir gcc-arm-none-eabi && \
curl -s -L "https://developer.arm.com/-/media/Files/downloads/gnu/${{env.arm_none_eabi_version}}.tar.xz" \
| tar -C gcc-arm-none-eabi --strip-components 1 -xJ
- name: Build
run: |
set -x
export PATH="${{GITHUB.WORKSPACE}}/gcc-arm-none-eabi/bin:$PATH"
mkdir build_slave
nuttx_src=${{GITHUB.WORKSPACE}}/nuttxspace/nuttx
build=${{GITHUB.WORKSPACE}}/build_slave
src=${{GITHUB.WORKSPACE}}/KickCAT
cp ${src}/examples/slave/nuttx/xmc4800/boards/relax/defconfig ${nuttx_src}/boards/arm/xmc4/xmc4800-relax/configs/nsh/defconfig
${nuttx_src}/tools/configure.sh -l xmc4800-relax:nsh
make -C ${nuttx_src} export
mkdir ${build}/nuttx-export
tar xf ${nuttx_src}/nuttx-export-*.tar.gz --strip-components=1 -C ${build}/nuttx-export
cmake -B ${build} -S ${src} -DCMAKE_TOOLCHAIN_FILE=${build}/nuttx-export/scripts/toolchain.cmake
make -C ${build}