123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312 |
- // Jest Snapshot v1, https://goo.gl/fbAQLP
-
- exports[`should follow and complete all steps: .NET: .github/workflows/build.yml 1`] = `
- "name: Build
-
- on:
- push:
- branches:
- - main
- pull_request:
- types: [opened, synchronize, reopened]
-
- jobs:
- build:
- name: Build and analyze
- runs-on: windows-latest
-
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- - name: Set up JDK 17
- uses: actions/setup-java@v1
- with:
- java-version: 17
- - name: Cache SonarQube packages
- uses: actions/cache@v1
- with:
- path: ~\\.sonar\\cache
- key: \${{ runner.os }}-sonar
- restore-keys: \${{ runner.os }}-sonar
- - name: Cache SonarQube scanner
- id: cache-sonar-scanner
- uses: actions/cache@v1
- with:
- path: .\\.sonar\\scanner
- key: \${{ runner.os }}-sonar-scanner
- restore-keys: \${{ runner.os }}-sonar-scanner
- - name: Install SonarQube scanner
- if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
- shell: powershell
- run: |
- New-Item -Path .\\.sonar\\scanner -ItemType Directory
- dotnet tool update dotnet-sonarscanner --tool-path .\\.sonar\\scanner
- - name: Build and analyze
- shell: powershell
- run: |
- .\\.sonar\\scanner\\dotnet-sonarscanner begin /k:"my-project" /d:sonar.token="\${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="\${{ secrets.SONAR_HOST_URL }}"
- dotnet build
- .\\.sonar\\scanner\\dotnet-sonarscanner end /d:sonar.token="\${{ secrets.SONAR_TOKEN }}""
- `;
-
- exports[`should follow and complete all steps: CFamily Linux: .github/workflows/build.yml 1`] = `
- "name: Build
-
- on:
- push:
- branches:
- - main
- pull_request:
- types: [opened, synchronize, reopened]
-
- jobs:
- build:
- name: Build and analyze
- runs-on: ubuntu-latest
- env:
- BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- - name: Install sonar-scanner and build-wrapper
- env:
- SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
- uses: SonarSource/sonarqube-github-c-cpp@v1
- - name: Run build-wrapper
- run: |
- build-wrapper-linux-x86-64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
- - name: Run sonar-scanner
- env:
- GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
- SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
- SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
- run: |
- sonar-scanner --define sonar.cfamily.build-wrapper-output="\${{ env.BUILD_WRAPPER_OUT_DIR }}""
- `;
-
- exports[`should follow and complete all steps: CFamily MacOS: .github/workflows/build.yml 1`] = `
- "name: Build
-
- on:
- push:
- branches:
- - main
- pull_request:
- types: [opened, synchronize, reopened]
-
- jobs:
- build:
- name: Build and analyze
- runs-on: macos-latest
- env:
- BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- - name: Install sonar-scanner and build-wrapper
- env:
- SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
- uses: SonarSource/sonarqube-github-c-cpp@v1
- - name: Run build-wrapper
- run: |
- build-wrapper-macosx-x86 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
- - name: Run sonar-scanner
- env:
- GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
- SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
- SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
- run: |
- sonar-scanner --define sonar.cfamily.build-wrapper-output="\${{ env.BUILD_WRAPPER_OUT_DIR }}""
- `;
-
- exports[`should follow and complete all steps: CFamily Windows: .github/workflows/build.yml 1`] = `
- "name: Build
-
- on:
- push:
- branches:
- - main
- pull_request:
- types: [opened, synchronize, reopened]
-
- jobs:
- build:
- name: Build and analyze
- runs-on: windows-latest
- env:
- BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- - name: Install sonar-scanner and build-wrapper
- env:
- SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
- uses: SonarSource/sonarqube-github-c-cpp@v1
- - name: Run build-wrapper
- run: |
- build-wrapper-win-x86-64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
- - name: Run sonar-scanner
- env:
- GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
- SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
- SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
- run: |
- sonar-scanner --define sonar.cfamily.build-wrapper-output="\${{ env.BUILD_WRAPPER_OUT_DIR }}""
- `;
-
- exports[`should follow and complete all steps: CFamily: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
-
- exports[`should follow and complete all steps: Gradle: .github/workflows/build.yml 1`] = `
- "name: Build
-
- on:
- push:
- branches:
- - main
- pull_request:
- types: [opened, synchronize, reopened]
-
- jobs:
- build:
- name: Build and analyze
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- - name: Set up JDK 17
- uses: actions/setup-java@v1
- with:
- java-version: 17
- - name: Cache SonarQube packages
- uses: actions/cache@v1
- with:
- path: ~/.sonar/cache
- key: \${{ runner.os }}-sonar
- restore-keys: \${{ runner.os }}-sonar
- - name: Cache Gradle packages
- uses: actions/cache@v1
- with:
- path: ~/.gradle/caches
- key: \${{ runner.os }}-gradle-\${{ hashFiles('**/*.gradle') }}
- restore-keys: \${{ runner.os }}-gradle
- - name: Build and analyze
- env:
- SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
- SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
- run: ./gradlew build sonar --info"
- `;
-
- exports[`should follow and complete all steps: Groovy: build.gradle 1`] = `
- "plugins {
- id "org.sonarqube" version "4.4.1.3373"
- }
-
- sonar {
- properties {
- property "sonar.projectKey", "my-project"
- property "sonar.projectName", "MyProject"
- }
- }"
- `;
-
- exports[`should follow and complete all steps: Kotlin: build.gradle.kts 1`] = `
- "plugins {
- id("org.sonarqube") version "4.4.1.3373"
- }
-
- sonar {
- properties {
- property("sonar.projectKey", "my-project")
- property("sonar.projectName", "MyProject")
- }
- }"
- `;
-
- exports[`should follow and complete all steps: Maven: .github/workflows/build.yml 1`] = `
- "name: Build
-
- on:
- push:
- branches:
- - main
- pull_request:
- types: [opened, synchronize, reopened]
-
- jobs:
- build:
- name: Build and analyze
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- - name: Set up JDK 17
- uses: actions/setup-java@v1
- with:
- java-version: 17
- - name: Cache SonarQube packages
- uses: actions/cache@v1
- with:
- path: ~/.sonar/cache
- key: \${{ runner.os }}-sonar
- restore-keys: \${{ runner.os }}-sonar
- - name: Cache Maven packages
- uses: actions/cache@v1
- with:
- path: ~/.m2
- key: \${{ runner.os }}-m2-\${{ hashFiles('**/pom.xml') }}
- restore-keys: \${{ runner.os }}-m2
- - name: Build and analyze
- env:
- SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
- SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
- run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'"
- `;
-
- exports[`should follow and complete all steps: Other: .github/workflows/build.yml 1`] = `
- "name: Build
-
- on:
- push:
- branches:
- - main
- pull_request:
- types: [opened, synchronize, reopened]
-
- jobs:
- build:
- name: Build and analyze
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- - uses: sonarsource/sonarqube-scan-action@master
- env:
- SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
- SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
- # If you wish to fail your job when the Quality Gate is red, uncomment the
- # following lines. This would typically be used to fail a deployment.
- # We do not recommend to use this in a pull request. Prefer using pull request
- # decoration instead.
- # - uses: sonarsource/sonarqube-quality-gate-action@master
- # timeout-minutes: 5
- # env:
- # SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}"
- `;
-
- exports[`should follow and complete all steps: Other: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
-
- exports[`should follow and complete all steps: sonar token key 1`] = `"SONAR_TOKEN"`;
-
- exports[`should follow and complete all steps: sonarqube host url key 1`] = `"SONAR_HOST_URL"`;
-
- exports[`should follow and complete all steps: sonarqube host url value 1`] = `"http://localhost:9000"`;
|