Improve base container #36
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
# Copyright (c) 2022-2023 Robert Bosch GmbH | |
# | |
# This program and the accompanying materials are made available under the | |
# terms of the Apache License, Version 2.0 which is available at | |
# https://www.apache.org/licenses/LICENSE-2.0. | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |
# License for the specific language governing permissions and limitations | |
# under the License. | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
name: SDK - CI workflow | |
concurrency: | |
group: sdk-ci-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
push: | |
# Run only on branches/commits and not tags | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
conan-package: | |
runs-on: ubuntu-22.04 | |
name: "Check Conan package" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: install prerequisites | |
run: | | |
sudo apt-get update && sudo apt-get install -y ninja-build clang-format-14 clang-tidy-14 cppcheck | |
pip3 install -r requirements.txt | |
- name: Export conan package | |
run: | | |
conan export . | |
- name: Check if conan package is installed | |
run: | | |
RECIPE_EXISTS=$(conan search vehicle-app-sdk | grep "Existing package recipes:") | |
if [ "$RECIPE_EXISTS" == "" ]; then | |
exit -1 | |
fi | |
build-and-publish: | |
runs-on: ubuntu-22.04 | |
name: "Build, Test and Lint" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Clone vehicle_model repository | |
uses: actions/checkout@v3 | |
with: | |
repository: eclipse-velocitas/vehicle-model-cpp | |
path: "./app/vehicle_model" | |
- name: install prerequisites | |
run: | | |
sudo apt-get update && sudo apt-get install -y ninja-build clang-format-14 clang-tidy-14 cppcheck | |
pip3 install -r requirements.txt | |
- name: Set up GCC | |
uses: egor-tensin/setup-gcc@v1 | |
with: | |
version: 11 | |
- name: Install dependencies | |
run: ./install_dependencies.sh -r | |
- name: build | |
run: ./build.sh -r | |
- name: unittests | |
run: build/bin/sdk_utests | |
- name: Generate coverage report | |
run: cd build && gcovr -r .. | |
- name: Code Coverage Summary Report | |
uses: irongut/CodeCoverageSummary@v1.3.0 | |
with: | |
filename: build/coverage.cobertura.xml | |
badge: true | |
format: markdown | |
hide_complexity: true | |
indicators: true | |
output: both | |
######################################################### | |
# This step was disabled temporarily due to the required | |
# write access rights of the PRs for external contributors. | |
######################################################### | |
#- name: Add Coverage PR Comment | |
# uses: marocchino/sticky-pull-request-comment@v2 | |
# if: github.event_name == 'pull_request' | |
# with: | |
# recreate: true | |
# path: code-coverage-results.md | |
- name: Run Linters | |
uses: pre-commit/action@v3.0.0 |