Skip to content

ci: add lint and cppcheck #9

ci: add lint and cppcheck

ci: add lint and cppcheck #9

Workflow file for this run

name: build-hello-world
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-hello-world:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install g++
run: sudo apt install -y g++ cppcheck
- name: run cppcheck
run: |
cppcheck hello_world.cpp --output-file=report.txt
if [ -s report.txt ]; then # if file is not empty
cat report.txt
exit 1 # let github action fails
fi
- name: check build
run: |
g++ hello_world.cpp -o hello_world
./hello_world