fix: Correção na resposta da API #27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: SonarCloud Analysis | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| sonarcloud: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Baixa o histórico de commits do repositório | |
| - name: Setup .NET 9 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: Cache SonarCloud packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.sonar/cache # pasta onde irá ficar guardado o cache | |
| # runner.os = pega o nome do sistema operacional | |
| key: ${{ runner.os }}-sonar # Nome único para identificar o cache | |
| restore-keys: ${{ runner.os }}-sonar # Chave alternativa se não encontrar a principal | |
| - name: Install SonarScanner | |
| run: dotnet tool install --global dotnet-sonarscanner | |
| - name: Generate .sln for compatibility | |
| run: | | |
| echo "Generating .sln from projects..." | |
| dotnet new sln -n riber | |
| find . -name "*.csproj" -not -path "*/obj/*" -not -path "*/bin/*" | xargs dotnet sln riber.sln add | |
| echo "Solution file created:" | |
| ls -lh riber.sln | |
| - name: Restore dependencies | |
| run: dotnet restore riber.sln | |
| - name: Run analisys with SonarScanner | |
| env: | |
| CI: true | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| SONAR_PROJECT_KEY: "${{ github.repository_owner }}_riber" | |
| SONAR_ORGANIZATION: "${{ github.repository_owner }}" | |
| run: | | |
| chmod +x analyze.sh | |
| ./analyze.sh |