Skip to content

Commit

Permalink
Add Cppcheck workflow, presets, and build steps [skip ci]
Browse files Browse the repository at this point in the history
- Added a new file `.github/workflows/cppcheck.yml` to include a Cppcheck workflow.
- Modified `.travis.yml` to comment out the CppCheck job.
- Modified `CMakePresets.json` to add a new preset for cppcheck.
- Updated badges in `README.md`.

This commit adds support for running Cppcheck as part of the CI/CD pipeline.
  • Loading branch information
acgetchell committed Nov 30, 2023
1 parent 8ef7e8b commit de41ab3
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 9 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/cppcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Cppcheck

on:
push:
branches:
- main
- develop
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true

- name: Setup
run: |
sudo apt update
sudo apt-get install build-essential automake autoconf autoconf-archive texinfo libtool-bin yasm ninja-build ccache cppcheck
- name: Setup GCC
uses: pkgxdev/setup@v1
with:
+: gcc@13

- run: gcc --version

- name: Restore artifacts or setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: ${{ vars.VCPKG_GIT_COMMIT_ID }}

- name: Configure
run: cmake --preset=cppcheck

- name: Build
run: cmake --build build -j 2
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ compiler:

jobs:
fast_finish: true
include:
# CppCheck
- os: linux
compiler: g++12
env: CPPCHECK=true
before_script:
- export CMAKE_ARGS="-D ENABLE_CPPCHECK:BOOL=TRUE"
after_success: skip
# include:
# # CppCheck
# - os: linux
# compiler: g++12
# env: CPPCHECK=true
# before_script:
# - export CMAKE_ARGS="-D ENABLE_CPPCHECK:BOOL=TRUE"
# after_success: skip
# # Valgrind
# - os: linux
# compiler: g++12
Expand Down
10 changes: 10 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@
"ENABLE_SANITIZER_UNDEFINED_BEHAVIOR": true
}
},
{
"name": "cppcheck",
"inherits": "ci-std",
"description": "This preset is used for cppcheck",
"cacheVariables": {
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_BUILD_TYPE": "Debug",
"ENABLE_CPPCHECK": true
}
},
{
"name": "lsan",
"inherits": "ci-unix",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

[![Linux Clang](https://github.com/acgetchell/CDT-plusplus/actions/workflows/linux-clang.yml/badge.svg)](https://github.com/acgetchell/CDT-plusplus/actions/workflows/linux-clang.yml)
[![Linux GCC](https://github.com/acgetchell/CDT-plusplus/actions/workflows/linux-gcc.yml/badge.svg)](https://github.com/acgetchell/CDT-plusplus/actions/workflows/linux-gcc.yml)
[![Windows Build status](https://img.shields.io/appveyor/ci/acgetchell/cdt-plusplus.svg?label=Windows)](https://ci.appveyor.com/project/acgetchell/cdt-plusplus)
[![macOS](https://github.com/acgetchell/CDT-plusplus/actions/workflows/macos.yml/badge.svg)](https://github.com/acgetchell/CDT-plusplus/actions/workflows/macos.yml)
[![Build status](https://ci.appveyor.com/api/projects/status/qjvbk6u86sp6cm59?svg=true&passingText=Windows)](https://ci.appveyor.com/project/acgetchell/cdt-plusplus)
[![CodeQL](https://github.com/acgetchell/CDT-plusplus/actions/workflows/codeql-analysis.yml/badge.svg?branch=develop)](https://github.com/acgetchell/CDT-plusplus/actions/workflows/codeql-analysis.yml)
[![codecov](https://codecov.io/gh/acgetchell/CDT-plusplus/branch/develop/graph/badge.svg)](https://codecov.io/gh/acgetchell/CDT-plusplus)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=acgetchell_CDT-plusplus&metric=alert_status)](https://sonarcloud.io/dashboard?id=acgetchell_CDT-plusplus)
Expand Down

0 comments on commit de41ab3

Please sign in to comment.