fix build under clang #46
Workflow file for this run
This file contains 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: Main Workflow | |
on: [push, pull_request] | |
jobs: | |
# socketcan/libcanard | |
socketcan: | |
strategy: | |
matrix: | |
build_type: ["Debug", "Release"] | |
env: | |
CC: gcc-10 | |
CXX: g++-10 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Install Dependencies | |
run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt update | |
sudo apt install gcc-10 g++-10 linux-libc-dev:i386 linux-*-extra-$(uname -r) | |
- name: Configure CMake | |
env: | |
BUILD_TYPE: ${{ matrix.build_type }} | |
working-directory: ${{github.workspace}}/socketcan/libcanard/ | |
run: cmake test -DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
- name: Build | |
working-directory: ${{github.workspace}}/socketcan/libcanard/ | |
run: make all VERBOSE=1 | |
- name: Test | |
working-directory: ${{github.workspace}}/socketcan/libcanard/ | |
run: make test | |
# stm32/libcanard/bxcan | |
stm32: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Install Dependencies | |
run: | | |
sudo apt update | |
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 12 | |
sudo apt install clang-tidy-12 clang-format-12 | |
- name: Static analysis | |
working-directory: ${{github.workspace}}/stm32/libcanard/bxcan/ | |
run: clang-tidy-12 src/*.c --extra-arg='-DBXCAN_MAX_IFACE_INDEX=1' --extra-arg='-DBXCAN_BUSYWAIT_DELAY_SYSTEM_CORE_CLOCK=72000000' | |
- name: Format check | |
working-directory: ${{github.workspace}}/stm32/libcanard/bxcan/ | |
run: | | |
clang-format-12 -i -fallback-style=none -style=file --verbose src/*.[ch] | |
modified="$(git status --porcelain --untracked-files=no)" | |
if [ -n "$modified" ]; then echo "Please format code properly."; exit 1; fi |