Add sonacloud #35
Workflow file for this run
This file contains hidden or 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: SonarCloud code analysis | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| env: | |
| BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18 | |
| registry-url: "https://npm.pkg.github.com" | |
| - name: Install node-gyp | |
| run: npm install -g node-gyp | |
| - run: npx node-gyp configure build | |
| - name: Install Build Wrapper | |
| uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v5 | |
| - name: Run Build Wrapper | |
| run: build-wrapper-win-x86-64.exe --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} npx node-gyp configure build | |
| - run: ls ${{ env.BUILD_WRAPPER_OUT_DIR }} | |
| - run: cat ${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json | |
| - run: cat ${{ env.BUILD_WRAPPER_OUT_DIR }}/build-wrapper.log | |
| - run: cat ${{ env.BUILD_WRAPPER_OUT_DIR }}/build-wrapper-dump.json | |
| - name: SonarQube Scan | |
| uses: SonarSource/sonarqube-scan-action@v5 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| with: | |
| args: > | |
| --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json" | |