fix: correção de sintaxe no workflow #144
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: CI Pipeline | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| paths: [ "src/**", "tests/**", ".github/**" ] | |
| push: | |
| branches: [ main ] | |
| paths: [ "src/**", "tests/**", ".github/**" ] | |
| jobs: | |
| test-and-build: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup .NET 10 | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.nuget/packages | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuget- | |
| - name: Restore NuGet packages | |
| run: dotnet restore | |
| - name: Build in Release mode | |
| run: dotnet build -c Release --no-restore | |
| - name: Run Unit tests | |
| run: dotnet test -c Release --no-build --verbosity minimal --filter Category=Unit | |
| - name: Run Integration tests | |
| run: dotnet test -c Release --no-build --verbosity minimal --filter Category=Integration | |
| sonarcloud: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET 10 | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Cache SonarCloud packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - 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: | |
| 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 |