Skip to content

Commit 690cd42

Browse files
committed
analysis
Signed-off-by: Anton Dukhovnikov <[email protected]>
1 parent 03675a2 commit 690cd42

File tree

2 files changed

+22
-39
lines changed

2 files changed

+22
-39
lines changed

.github/workflows/analysis.yml

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,28 @@ concurrency:
3737

3838
jobs:
3939
analysis:
40-
name: "SonarCloud Analysis ${{ matrix.compiler[0] }}"
40+
name: "Static analysis"
4141
# Exclude runs on forks, since only the main org has the SonarCloud
4242
# account credentials.
4343
# if: github.repository == 'AcademySoftwareFoundation/rawtoaces'
4444
# secrets:
4545
# PASSED_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4646
# PASSED_SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4747
runs-on: ubuntu-latest
48-
container:
49-
image: aswf/ci-osl:2024-clang17.2
48+
# container:
49+
# image: aswf/ci-osl:2024-clang17.2
5050
strategy:
5151
fail-fast: false
52-
matrix:
53-
compiler: [ [gcc, g++], [clang, clang] ]
5452
env:
55-
CC: ${{ matrix.compiler[0] }}
56-
CXX: ${{ matrix.compiler[1] }}
53+
CC: clang
54+
CXX: clang++
5755
steps:
5856
- uses: actions/checkout@v4
5957

6058
- name: Dependencies
6159
shell: bash
6260
run: |
63-
sudo yum install --setopt=tsflags=nodocs -y eigen3-devel ceres-solver-devel json-devel
61+
build_scripts/install_deps_linux.bash
6462
6563
- name: Install sonar-scanner and build-wrapper
6664
uses: sonarsource/sonarcloud-github-c-cpp@e4882e1621ad2fb48dddfa48287411bed34789b1 # v2.0.2
@@ -75,36 +73,14 @@ jobs:
7573
-D CMAKE_BUILD_TYPE=Debug
7674
-D ENABLE_COVERAGE=ON
7775
-D CMAKE_CXX_FLAGS="-g -O0"
76+
-D CMAKE_EXPORT_COMPILE_COMMANDS=ON
7877
79-
- name: Build
80-
run: |
81-
sudo cmake --build build
82-
sudo cmake --install build
78+
- uses: whisperity/codechecker-analysis-action@v1
79+
id: codechecker
80+
with:
81+
logfile: ${{ github.workspace }}/build/compile_commands.json
8382

84-
- name: Test
85-
working-directory: build
86-
run: >
87-
ctest
88-
--build-config Debug
89-
--rerun-failed
90-
--output-on-failure
91-
92-
- name: Generate coverage report
93-
run: |
94-
cd build
95-
make coverage
96-
97-
- name: Sonar-scanner
98-
env:
99-
SONAR_SERVER_URL: https://sonarcloud.io
100-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
102-
BUILD_WRAPPER_OUT_DIR: build
103-
run: |
104-
which sonar-scanner
105-
ls -l /__w/rawtoaces/rawtoaces/build
106-
echo "BUILD_OUTPUT_DIR is " "${{ env.BUILD_WRAPPER_OUT_DIR }}"
107-
find . -name "*.gcov" -print
108-
# sonar-scanner --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"
109-
time sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.compile-commands="$BUILD_WRAPPER_OUT_DIR/compile_commands.json" --define sonar.cfamily.gcov.reportsPath="_coverage" --define sonar.cfamily.threads="$PARALLEL"
110-
# Consult https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarscanner-cli/ for more information and options
83+
- uses: actions/upload-artifact@v2
84+
with:
85+
name: "CodeChecker Bug Reports"
86+
path: ${{ steps.codechecker.outputs.result-html-dir }}

src/rawtoaces/main.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ int main( int argc, const char *argv[] )
1212
#else
1313
_putenv( (char *)"TZ=UTC" );
1414
#endif
15+
16+
17+
int x;
18+
19+
int y = x;
20+
std::cerr << y;
21+
1522

1623
rta::util::ImageConverter converter;
1724

0 commit comments

Comments
 (0)