I have an error on the GitHub action when run sonar cloud scan, this is a detail of error

java.lang.IllegalStateException: The "build-wrapper-dump.json" file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:
  * you are using the latest version of the build-wrapper and the CFamily analyzer
  * you are correctly invoking the scanner with correct configuration
  * your compiler is supported
  * you are wrapping your build correctly
  * you are wrapping a full/clean build
  * you are providing the path to the correct build-wrapper output directory
  * you are building and analyzing the same source checkout, absolute paths must be identical in build and analysis steps```

this is some step in sonar.yml

- name: Install build-wrapper
        run: |
          wget https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
          unzip build-wrapper-linux-x86.zip
          mkdir -p C++/build1/
          mv build-wrapper-linux-x86/* C++/build1/
          chmod +x C++/build1/build-wrapper-linux-x86-64

      - name: Install CMake
        run: |
          sudo apt-get update
          sudo apt-get install -y software-properties-common
          sudo add-apt-repository 'deb https://apt.kitware.com/ubuntu/ focal main'
          sudo apt-get install -y cmake

      - name: Configure
        run: |
          cd C++/build1/
          cmake ..

      - name: Clean Build
        run: cmake --build C++/build1/ --target clean

      - name: Run build-wrapper
        run: C++/build1/build-wrapper-linux-x86-64 --out-dir bw-output /usr/bin/cmake --build C++/build1

      - name: SonarCloud Scan
        uses: SonarSource/sonarcloud-github-action@master

I'm trying to scan .cpp file in my repository, i'm expected for pass scan and show result in sonarcloud dashboard.

0

There are 0 best solutions below