Skip to content

Valgrind on native #135

Valgrind on native

Valgrind on native #135

#
# If not stated otherwise in this file or this component's LICENSE file the
# following copyright and licenses apply:
#
# Copyright 2024 Sky UK
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://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.
#
# This workflow builds and runs the rialto server component tests with valgrind. The workflow shall fail if
# any test fails or a memory leak is detected by valgrind and the results of the tests are displayed in a table
# in github.
name: valgrind_server_component_tests
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master", "rdkcentral:master" ]
pull_request:
branches: [ "master", "rdkcentral:master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This job sets up the repo with the dependancies then runs the server component tests with valgrind
run-valgrind-server-test:
name: Build and test server component tests with valgrind
# Runs on ubuntu
runs-on: ubuntu-22.04
# Timeout after
timeout-minutes: 10
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout repo
uses: actions/checkout@v4
# Initialises the host ready to run component tests
- name: Initialise host
uses: ./.github/workflows/actions/init_ut
- name: Install valgrind library
run: |
sudo apt-get install valgrind
# Run the build script for server with valgrind
- name: build_ct.py script server with valgrind
run: |
python build_ct.py -c -xml -f -s server -val
# Process the valgrind results and create a csv
- name: Process valgrind results
id: create-valgrind-csv
if: success() || failure()
run: python scripts/valgrind/process_valgrind_results.py
# Read the valgrind results csv file
- name: Read the valgrind results csv
uses: juliangruber/read-file-action@v1
id: csv-memory
if: success() || failure()
with:
path: ./valgrind_report.csv
# Create results table for valgrind results
- name: Create results table
uses: petems/csv-to-md-table-action@master
id: results-table-output
if: success() || failure()
with:
csvinput: ${{ steps.csv-memory.outputs.content }}
# Add table to the summary
- name: Create results table
if: failure()
run: |
echo "Summary of the valgrind failures" >> $GITHUB_STEP_SUMMARY
echo "${{steps.results-table-output.outputs.markdown-table}}" >> $GITHUB_STEP_SUMMARY
# Upload logs on failure
- name: Upload logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: logs
path: |
gtest_result.log
build/*valgrind_report.xml