Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-15034

Explain how to analyse C/C++/Objective C with Gitlab-CI

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9.0
    • Component/s: Web
    • Labels:
      None
    • Edition:
      Developer
    • Production Notes:
      None

      Description

      GitLab.com doesn’t offer macOS images. Building on Windows machines is not configured the same way for GitLab.com and GitLab Self-Managed. In order to avoid confusion, we will not provide Windows tutorials on GitLab CI/CD.

       

      Linux:

      Example: https://gitlab.com/zipeng-wu-sonarsource/sonarcloud_example_cpp-cmake-linux-otherci

       

      image: rikorose/gcc-cmake
      
      cache:
        paths:
          - .sonar
      
      stages:
        - download
        - build
        - scan
      
      download:
        stage: download
        script:
            - mkdir -p .sonar
            - curl -sSLo build-wrapper-linux-x86.zip  [REPLACE WITH URL IN FRONTEND]/static/cpp/build-wrapper-linux-x86.zip
            - unzip -o build-wrapper-linux-x86.zip -d .sonar
      
      build:
        stage: build
        script:
            - .sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir .sonar/bw-output <your clean build command>
      
      sonarqube-check:
        stage: scan
        script: 
          - curl -sSLo sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip
          - unzip -o sonar-scanner.zip -d .sonar
          - .sonar/sonar-scanner-4.6.2.2472-linux/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=.sonar/bw-output
      

       

       

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mathieu.suen Mathieu Suen
              Reporter:
              zipeng.wu Zipeng Wu
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: