fix issues detected by clang-tidy #794
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: Pull Request | |
on: pull_request | |
jobs: | |
checkpatch_review: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Calculate PR commits + 1' | |
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> $GITHUB_ENV | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: ${{ env.PR_FETCH_DEPTH }} | |
- name: Run checkpatch review | |
uses: webispy/checkpatch-action@v9 | |
clang_tidy_review: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Run clang-tidy review | |
uses: kimhyungrok/[email protected] | |
with: | |
exclude: 'externals /usr' | |
cppcheck: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Generate compile_commands.json | |
run: | | |
mkdir build | |
docker run -t --rm -v $PWD:$PWD -w $PWD/build \ | |
nugulinux/devenv:focal cmake .. | |
- name: Run cppcheck | |
run: | | |
docker run -t --rm -v $PWD:$PWD -w $PWD \ | |
ghcr.io/facthunder/cppcheck:2.6 \ | |
cppcheck --project=build/compile_commands.json \ | |
--suppressions-list=.cppcheck_suppress.txt \ | |
--enable=all -j 6 -iexternals | |
build_linux: | |
runs-on: ubuntu-latest | |
needs: [checkpatch_review, clang_tidy_review] | |
strategy: | |
fail-fast: true | |
matrix: | |
target: | |
[ | |
bionic_x64, | |
bionic_arm64, | |
bionic_armhf, | |
focal_x64, | |
focal_arm64, | |
focal_armhf, | |
jammy_x64, | |
jammy_arm64, | |
jammy_armhf, | |
] | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Build | |
run: | | |
whoami | |
pwd | |
ls -la | |
cd .. | |
pwd | |
ls -la | |
chmod 777 $PWD | |
chmod 777 $PWD/nugu-linux | |
ls -la | |
ls -la $PWD/nugu-linux | |
docker run -t --rm --privileged \ | |
-v $PWD:$PWD \ | |
-v /var/lib/schroot/chroots \ | |
-w $PWD/nugu-linux \ | |
nugulinux/buildenv:${{ matrix.target }} \ | |
sdkbuild.sh | |
ls -la | |
mkdir /tmp/result | |
cp *.deb /tmp/result/ | |
- name: Build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: DEB packages | |
path: /tmp/result/ | |