|
14 | 14 | name: Build |
15 | 15 | runs-on: windows-latest |
16 | 16 | steps: |
17 | | - - name: Set up JDK 11 |
18 | | - uses: actions/setup-java@v4 |
19 | | - with: |
20 | | - java-version: 11 |
21 | | - distribution: 'temurin' |
22 | | - |
23 | 17 | - name: Checkout repository with submodules |
24 | 18 | uses: actions/checkout@v4 |
25 | 19 | with: |
|
32 | 26 | key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} |
33 | 27 | restore-keys: | |
34 | 28 | ${{ runner.os }}-nuget- |
35 | | - - name: Cache SonarCloud packages |
36 | | - uses: actions/cache@v4 |
37 | | - with: |
38 | | - path: ~\sonar\cache |
39 | | - key: ${{ runner.os }}-sonar |
40 | | - restore-keys: ${{ runner.os }}-sonar |
41 | | - |
42 | | - - name: Cache SonarCloud scanner |
43 | | - id: cache-sonar-scanner |
44 | | - uses: actions/cache@v4 |
45 | | - with: |
46 | | - path: .\.sonar\scanner |
47 | | - key: ${{ runner.os }}-sonar-scanner |
48 | | - restore-keys: ${{ runner.os }}-sonar-scanner |
49 | | - |
50 | | - - name: Install SonarCloud scanner |
51 | | - if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' |
52 | | - shell: powershell |
53 | | - run: | |
54 | | - New-Item -Path .\.sonar\scanner -ItemType Directory |
55 | | - dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner |
56 | | -
|
57 | 29 | - name: Restore dependencies |
58 | 30 | run: dotnet restore |
59 | | - |
60 | | - - name: Build and analyze |
61 | | - env: |
62 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
63 | | - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
64 | | - shell: powershell |
65 | | - run: | |
66 | | - .\.sonar\scanner\dotnet-sonarscanner begin /k:"Geta_${{ github.event.repository.name }}" /o:"geta" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths=**/**/coverage.opencover.xml |
67 | | - dotnet build |
68 | | - dotnet test --filter Category!=Integration /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=coverage |
69 | | - .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" |
| 31 | + - name: Build |
| 32 | + run: dotnet build --configuration Release --no-restore |
| 33 | + - name: Test |
| 34 | + run: dotnet test --configuration Release --no-build |
0 commit comments