Add Noble #401
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
name: Static analysis | |
on: [ push, pull_request ] | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: RelWithDebInfo | |
jobs: | |
clang-tidy: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Create Build Environment | |
# Some projects don't allow in-source building, so create a separate build directory | |
# We'll use this as our working directory for all subsequent commands | |
run: cmake -E make_directory ${{runner.workspace}}/build | |
- name: Update apt package repos | |
run: > | |
sudo apt-get update | |
- name: Install apt packages | |
run: > | |
sudo apt-get -yq --no-install-suggests --no-install-recommends install | |
libboost-dev | |
libboost-filesystem-dev | |
libboost-program-options-dev | |
libboost-system-dev | |
libboost-test-dev | |
libboost-thread-dev | |
libcairo2-dev | |
libglib2.0-dev | |
libgtest-dev | |
libgtk-3-dev | |
libtiff5-dev | |
pkg-config | |
clang-tidy | |
- name: Get Codacy Clang-tidy | |
env: | |
CODACY_CLANG_TIDY: https://github.com/codacy/codacy-clang-tidy/ | |
VERSION: 1.2.1 | |
working-directory: /tmp | |
run: | | |
curl -L https://github.com/codacy/codacy-clang-tidy/releases/download/${VERSION}/codacy-clang-tidy-${VERSION} --output codacy-clang-tidy-latest | |
curl -L https://github.com/codacy/codacy-clang-tidy/archive/${VERSION}.tar.gz | tar xz | |
mv codacy-clang-tidy-${VERSION}/ codacy-clang-tidy | |
chmod +x codacy-clang-tidy/scripts/send-results.sh codacy-clang-tidy-latest | |
- name: Configure CMake | |
working-directory: ${{runner.workspace}}/build | |
# Note the current convention is to use the -S and -B options here to specify source | |
# and build directories, but this is only available with CMake 3.13 and higher. | |
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12 | |
run: | | |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang | |
- name: Clang-Tidy | |
# Execute the build. You can specify a specific target with "--target <NAME>" | |
run: | | |
set -o pipefail | |
find . -name \*.cc -print0 | parallel -0 clang-tidy-10 --quiet -p="${{runner.workspace}}/build" \{\} | tee ct.log | |
- name: Upload to Codacy | |
env: | |
PROJECT_TOKEN: ${{ secrets.CODACY_API_KEY }} | |
COMMIT: ${{ github.sha }} | |
if: env.PROJECT_TOKEN != 0 | |
run: | | |
mv /tmp/codacy-clang-tidy-latest . | |
/tmp/codacy-clang-tidy/scripts/send-results.sh < ct.log |