Skip to content

Add codecov token. #145

Add codecov token.

Add codecov token. #145

Workflow file for this run

# SPDX-FileCopyrightText: 2023 Comcast Cable Communications Management, LLC
# SPDX-License-Identifier: Apache-2.0
name: CI
on:
pull_request:
push:
paths-ignore:
- 'AUTHORS'
- 'LICENSE'
- 'NOTICE'
- '**.md'
- '.gitignore'
tags-ignore:
- 'v[0-9]+.[0-9]+.[0-9]+'
branches:
- main
- master
jobs:
test:
name: Unit Tests
runs-on: [ ubuntu-latest ]
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
fetch-depth: 0
# Install the dependent packages
- name: Install packages
run: |
sudo apt update
sudo apt-get -y install valgrind libcunit1 libcunit1-doc libcunit1-dev libmsgpack-dev gcovr libtool xsltproc docbook-xsl
pip install codecov
- name: Make Build Directory
run: mkdir build
- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v2
- name: CMake
working-directory: build
run: |
cmake .. -DINTEGRATION_TESTING:BOOL=false -DDISABLE_VALGRIND:BOOL=${DISABLE_VALGRIND} -DENABLE_SESHAT:BOOL=true -DFEATURE_DNS_QUERY:BOOL=true
- name: Build
working-directory: build
run: |
ps aux
build-wrapper-linux-x86-64 --out-dir bw-output make
- name: Get rtrouted Binary
working-directory: build
run: |
../.github/scripts/rtrouted.sh
- name: Unit tests run
working-directory: build
run: |
export RBUS_ROOT=${HOME}/rbus
export RBUS_INSTALL_DIR=${RBUS_ROOT}/install
export PATH=${RBUS_INSTALL_DIR}/usr/bin:${PATH}
export LD_LIBRARY_PATH=${RBUS_INSTALL_DIR}/usr/lib:${LD_LIBRARY_PATH}
./tests/test_mqttcm_component -a
./tests/test_mqttcm_timer -a
./tests/test_mqttcm_webcfg -a
./tests/test_mqttcm_generic -a
./tests/test_mqttcm_connect -a
./tests/test_mqttcm_rbus -a
./tests/test_mock_mqttcm_connect -a
- name: Stop rtrouted
run: |
killall -9 rtrouted
- name: Merge GCOV Reports for Sonarcloud
working-directory: build
run: |
gcovr --sonarqube coverage.xml -r ..
- name: Upload Codecov.io
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
directory: .
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload SonarCloud
run: |
build/sonar-scanner/bin/sonar-scanner -Dsonar.host.url=https://sonarcloud.io -Dproject.settings=.sonar-project.properties -Dsonar.login=${{ secrets.SONAR_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}