Adapt iterators and unify exception handling #612
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: Build and test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- develop | |
- feature_* | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
permissions: read-all | |
container: | |
image: ghcr.io/aosedge/aos-core-build-base:latest | |
options: '--entrypoint /usr/bin/bash' | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
steps: | |
# Apply solution to "HOME is overridden for containers" problem: https://github.com/actions/runner/issues/863 | |
- name: Preserve $HOME set in the container | |
run: echo HOME=/root >> "$GITHUB_ENV" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: 'recursive' | |
- name: Build and test | |
run: | | |
mkdir build | |
conan profile detect --force | |
conan install ./conan/ --output-folder build --settings=build_type=Debug --options=with_poco=True --build=missing | |
cmake ./ -B./build/ -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake -DWITH_TEST=ON -DWITH_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug | |
cd build | |
make; make tests; make coverage | |
- name: Static analysis | |
run: | | |
cppcheck --enable=all --inline-suppr -I src --std=c++17 --error-exitcode=1 \ | |
--suppressions-list=./suppressions.txt -I external/aos_core_common_cpp/include src | |
- name: Upload codecov report | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./build/coverage.total |