Skip to content

Commit

Permalink
add: qodana static code analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
Costallat committed Aug 2, 2024
1 parent 7583ceb commit 4b98507
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 64 deletions.
124 changes: 62 additions & 62 deletions .github/workflows/analysis-qodana-docker.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
---
name: Qodana-Docker
on:
workflow_dispatch:
pull_request:
push:
branches:
- main

jobs:
qodana:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
checks: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Install Linux Dependencies
run: >
sudo apt-get update && sudo apt-get install ccache
linux-headers-$(uname -r)
- name: CCache
uses: hendrikmuhs/ccache-action@main
with:
max-size: "1G"
key: ccache-qodana

- name: Restore artifacts and install vcpkg
id: vcpkg-step
run: |
vcpkgCommitId=$(grep '.builtin-baseline' vcpkg.json | awk -F: '{print $2}' | tr -d '," ')
echo "vcpkg commit ID: $vcpkgCommitId"
echo "VCPKG_GIT_COMMIT_ID=$vcpkgCommitId" >> $GITHUB_ENV
- name: Get vcpkg commit id from vcpkg.json
uses: lukka/run-vcpkg@main
with:
vcpkgGitURL: "https://github.com/microsoft/vcpkg.git"
vcpkgGitCommitId: ${{ env.VCPKG_GIT_COMMIT_ID }}

- name: Get latest CMake and ninja
uses: lukka/get-cmake@main

- name: Run CMake
uses: lukka/run-cmake@main
with:
configurePreset: linux-debug

- name: Qodana Scan
run: |
docker run \
-v $(pwd):/data/project/ \
-v $(pwd):$(pwd) \
-e QODANA_TOKEN="${{ secrets.QODANA_TOKEN }}" \
jetbrains/qodana-clang:2024.1-eap \
--compile-commands ./build/linux-debug/compile_commands.json
# ---

Check failure on line 1 in .github/workflows/analysis-qodana-docker.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/analysis-qodana-docker.yml#L1

workflow is empty [syntax-check]
Raw output
.github/workflows/analysis-qodana-docker.yml:1:1: workflow is empty [syntax-check]
# name: Qodana-Docker
# on:
# workflow_dispatch:
# pull_request:
# push:
# branches:
# - main

# jobs:
# qodana:
# runs-on: ubuntu-latest
# permissions:
# contents: write
# pull-requests: write
# checks: write
# steps:
# - uses: actions/checkout@v3
# with:
# ref: ${{ github.event.pull_request.head.sha }}
# fetch-depth: 0

# - name: Install Linux Dependencies
# run: >
# sudo apt-get update && sudo apt-get install ccache
# linux-headers-$(uname -r)

# - name: CCache
# uses: hendrikmuhs/ccache-action@main
# with:
# max-size: "1G"
# key: ccache-qodana

# - name: Restore artifacts and install vcpkg
# id: vcpkg-step
# run: |
# vcpkgCommitId=$(grep '.builtin-baseline' vcpkg.json | awk -F: '{print $2}' | tr -d '," ')
# echo "vcpkg commit ID: $vcpkgCommitId"
# echo "VCPKG_GIT_COMMIT_ID=$vcpkgCommitId" >> $GITHUB_ENV

# - name: Get vcpkg commit id from vcpkg.json
# uses: lukka/run-vcpkg@main
# with:
# vcpkgGitURL: "https://github.com/microsoft/vcpkg.git"
# vcpkgGitCommitId: ${{ env.VCPKG_GIT_COMMIT_ID }}

# - name: Get latest CMake and ninja
# uses: lukka/get-cmake@main

# - name: Run CMake
# uses: lukka/run-cmake@main
# with:
# configurePreset: linux-debug

# - name: Qodana Scan
# run: |
# docker run \
# -v $(pwd):/data/project/ \
# -v $(pwd):$(pwd) \
# -e QODANA_TOKEN="${{ secrets.QODANA_TOKEN }}" \
# jetbrains/qodana-clang:2024.1-eap \
# --compile-commands ./build/linux-debug/compile_commands.json
3 changes: 1 addition & 2 deletions qodana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ bootstrap: |
set -x
sudo apt-get update
sudo apt-get install -y cmake git unzip build-essential ca-certificates curl zip unzip tar pkg-config ninja-build autoconf automake libtool python3
export oldDir=$(pwd)
cd ~
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
git checkout 095ee06e7f60dceef7d713e3f8b1c2eb10d650d7
./bootstrap-vcpkg.sh
cd $oldDir
cd /data/project
rm -rf build
mkdir -p build
cd build
Expand Down

0 comments on commit 4b98507

Please sign in to comment.