Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SonarCloud check improvement #2752

Closed
yurake opened this issue Oct 14, 2022 · 0 comments · Fixed by #2764
Closed

SonarCloud check improvement #2752

yurake opened this issue Oct 14, 2022 · 0 comments · Fixed by #2764
Assignees
Labels
feature_request A comment, message, or ask from a user to implement a specific feature java Pull requests that update Java code quarkus someone for quarkus

Comments

@yurake
Copy link
Owner

yurake commented Oct 14, 2022

Description

  • fix the analysis has warnings
    Shallow clone detected during the analysis. Some files will miss SCM information. This will affect features like auto-assignment of issues. Please configure your build to disable shallow clone.
- uses: actions/checkout@v3
  with:
    fetch-depth: 0
  • use sonarcloud cache
    github-action saple below
name: Build
on:
  push:
    branches:
      - master
  pull_request:
    types: [opened, synchronize, reopened]
jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - name: Cache SonarCloud 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:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
        run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=yurake_jaxrs-hazelcast-quarkus

Related links

@yurake yurake added enhancement feature_request A comment, message, or ask from a user to implement a specific feature labels Oct 14, 2022
@yurake yurake self-assigned this Oct 14, 2022
@issuelabeler issuelabeler bot added java Pull requests that update Java code quarkus someone for quarkus labels Oct 14, 2022
yurake added a commit that referenced this issue Oct 14, 2022
yurake added a commit that referenced this issue Oct 14, 2022
@yurake yurake linked a pull request Oct 14, 2022 that will close this issue
@github-actions github-actions bot added this to To do in Feature request Oct 14, 2022
Feature request automation moved this from To do to Done Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature_request A comment, message, or ask from a user to implement a specific feature java Pull requests that update Java code quarkus someone for quarkus
Projects
Development

Successfully merging a pull request may close this issue.

1 participant