diff --git a/.github/workflows/sonar-analysis.yml b/.github/workflows/sonar-analysis.yml new file mode 100644 index 00000000..3b797e49 --- /dev/null +++ b/.github/workflows/sonar-analysis.yml @@ -0,0 +1,50 @@ +name: Pull request checks + +on: + pull_request: + types: [opened, synchronize, reopened] + push: + branches: + - main + +jobs: + sonar_analysis: + runs-on: windows-latest + timeout-minutes: 15 + + 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@v4 + with: + node-version: 20 + + - name: Install Windows SDK 10.0.22621.0 + uses: ChristopheLav/windows-sdk-install@88d72875fb873886ea398ed04041446da6f26f86 # v1.0.3 + with: + version-sdk: 22621 + features: "OptionId.DesktopCPPx86,OptionId.DesktopCPPx64" + + - name: Install node-gyp + run: npm install -g node-gyp + + - name: Install build wrapper + uses: SonarSource/sonarqube-scan-action/install-build-wrapper@1a6d90ebcb0e6a6b1d87e37ba693fe453195ae25 # v5.3.1 + + - name: Run build wrapper + run: build-wrapper-win-x86-64.exe --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmd /c "node-gyp configure build" + + - name: SonarQube Scan + uses: SonarSource/sonarqube-scan-action@1a6d90ebcb0e6a6b1d87e37ba693fe453195ae25 # v5.3.1 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + args: > + --define sonar.cfamily.compile-commands=${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json diff --git a/dist/addon.node b/dist/addon.node index 4266ef8a..aaf5619a 100644 Binary files a/dist/addon.node and b/dist/addon.node differ diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000..5add1165 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,2 @@ +sonar.projectKey=internxt_node-win +sonar.organization=internxt