Versions of Github actions updated #94
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
# | |
# If not stated otherwise in this file or this component's LICENSE file the | |
# following copyright and licenses apply: | |
# | |
# Copyright 2023 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 runs cpplint against the rialto code, which checks that the coding guidelines are. | |
# adhered too. The workflow shall fail if any errors are detected and the results are displayed | |
# in github. Logs are uploaded on failure. | |
name: cpplint | |
# 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 runs the cpplint script and processes the results | |
run-cpplint: | |
name: Run cpplint.py | |
# Runs on ubuntu | |
runs-on: ubuntu-22.04 | |
# Timeout after | |
timeout-minutes: 2 | |
# 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 | |
# Setup github for python 3.8 | |
- name: setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
# Sudo apt update | |
- name: Sudo apt update | |
run: | | |
sudo apt-get update | |
# Run the build script and output errors to file | |
# Proccess returns error if failure detected | |
- name: cpplint.py script | |
run: | | |
python3 scripts/cpplint/cpplint.py --recursive --output=junit . 2> cpplint_errors.xml | |
# Process the errors on failure | |
- name: Check results | |
uses: dorny/test-reporter@v1 | |
if: failure() | |
with: | |
name: Cpplint errors | |
path: cpplint_errors.xml | |
reporter: java-junit | |
# Upload logs on failure | |
- name: Upload logs | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: logs | |
path: | | |
cpplint_errors.xml |