From: 7PH Date: Thu, 12 Sep 2024 11:32:22 +0000 (+0200) Subject: SONAR-22948 Update recommended GitHub Actions tutorial versions X-Git-Tag: 10.7.0.96327~99 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=02a62aadd1447a91c8d49f5d6e52ec0b2e64d939;p=sonarqube.git SONAR-22948 Update recommended GitHub Actions tutorial versions --- diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap index 182aded2f28..98d789f4c4a 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap @@ -20,18 +20,19 @@ jobs: 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 + uses: actions/setup-java@v4 with: java-version: 17 + distribution: 'zulu' # Alternative distribution options are available. - name: Cache SonarQube packages - uses: actions/cache@v1 + uses: actions/cache@v4 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 + uses: actions/cache@v4 with: path: .\\.sonar\\scanner key: \${{ runner.os }}-sonar-scanner @@ -69,7 +70,7 @@ jobs: - 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 + - uses: sonarsource/sonarqube-scan-action@v2 env: SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }} @@ -102,7 +103,7 @@ jobs: - 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 + - uses: sonarsource/sonarqube-scan-action@v2 env: SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }} @@ -286,17 +287,18 @@ jobs: 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 + uses: actions/setup-java@v4 with: java-version: 17 + distribution: 'zulu' # Alternative distribution options are available. - name: Cache SonarQube packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.sonar/cache key: \${{ runner.os }}-sonar restore-keys: \${{ runner.os }}-sonar - name: Cache Gradle packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.gradle/caches key: \${{ runner.os }}-gradle-\${{ hashFiles('**/*.gradle') }} @@ -354,17 +356,18 @@ jobs: 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 + uses: actions/setup-java@v4 with: java-version: 17 + distribution: 'zulu' # Alternative distribution options are available. - name: Cache SonarQube packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.sonar/cache key: \${{ runner.os }}-sonar restore-keys: \${{ runner.os }}-sonar - name: Cache Maven packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.m2 key: \${{ runner.os }}-m2-\${{ hashFiles('**/pom.xml') }} diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/DotNet.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/DotNet.tsx index 3478dfa49d4..cfb0fdf3ec7 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/DotNet.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/DotNet.tsx @@ -34,18 +34,19 @@ export interface DotNetProps { function dotnetYamlSteps(projectKey: string) { return ` - name: Set up JDK 17 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: java-version: 17 + distribution: 'zulu' # Alternative distribution options are available. - name: Cache SonarQube packages - uses: actions/cache@v1 + uses: actions/cache@v4 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 + uses: actions/cache@v4 with: path: .\\.sonar\\scanner key: \${{ runner.os }}-sonar-scanner diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/Gradle.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/Gradle.tsx index 85ae9f9b7c2..985c0cc62a6 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/Gradle.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/Gradle.tsx @@ -34,17 +34,18 @@ export interface GradleProps { const GRADLE_YAML_STEPS = ` - name: Set up JDK 17 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: java-version: 17 + distribution: 'zulu' # Alternative distribution options are available. - name: Cache SonarQube packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.sonar/cache key: \${{ runner.os }}-sonar restore-keys: \${{ runner.os }}-sonar - name: Cache Gradle packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.gradle/caches key: \${{ runner.os }}-gradle-\${{ hashFiles('**/*.gradle') }} diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/JavaMaven.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/JavaMaven.tsx index 946766e52f7..36270867aa6 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/JavaMaven.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/JavaMaven.tsx @@ -34,17 +34,18 @@ export interface JavaMavenProps { function mavenYamlSteps(projectKey: string, projectName: string) { return ` - name: Set up JDK 17 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: java-version: 17 + distribution: 'zulu' # Alternative distribution options are available. - name: Cache SonarQube packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.sonar/cache key: \${{ runner.os }}-sonar restore-keys: \${{ runner.os }}-sonar - name: Cache Maven packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.m2 key: \${{ runner.os }}-m2-\${{ hashFiles('**/pom.xml') }} diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/Others.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/Others.tsx index 44381ff0716..91f0ba3839d 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/Others.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/Others.tsx @@ -34,7 +34,7 @@ export interface OthersProps { function otherYamlSteps(branchesEnabled: boolean) { let output = ` - - uses: sonarsource/sonarqube-scan-action@master + - uses: sonarsource/sonarqube-scan-action@v2 env: SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}