Release 2.0.0-beta.2 #2846
This file contains 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: Sonar | |
on: push | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
Code-Quality: | |
runs-on: ubuntu-latest | |
if: github.actor != 'dependabot[bot]' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9.0.x | |
- name: Install Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: microsoft | |
java-version: 21 | |
- name: Install Sonar Scanner | |
run: dotnet tool install --global dotnet-sonarscanner | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Start Sonar Analysis | |
run: dotnet-sonarscanner begin -d:sonar.host.url="https://sonarcloud.io" -d:sonar.login="${{ secrets.SONAR_TOKEN }}" -o:"ecoapm" -k:"ecoAPM_WiFiSurveyor-Server" -d:sonar.cs.vstest.reportsPaths="*.Tests/**/results.trx" -d:sonar.cs.opencover.reportsPaths="*.Tests/**/coverage.opencover.xml" -d:sonar.exclusions="App*/**" | |
- name: Build | |
run: dotnet build --no-restore | |
env: | |
SONAR_DOTNET_ENABLE_CONCURRENT_EXECUTION: true | |
- name: Test | |
run: dotnet test --no-build --logger "trx;LogFileName=results.trx" --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover | |
- name: Remove client-side Sonar properties | |
run: rm sonar-project.properties | |
- name: Finish Sonar Analysis | |
run: dotnet-sonarscanner end -d:sonar.login="${{ secrets.SONAR_TOKEN }}" | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
App-Code-Quality: | |
runs-on: ubuntu-latest | |
if: github.actor != 'dependabot[bot]' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Install c8 | |
run: yarn global add c8 | |
- name: Install dependencies | |
run: yarn | |
- name: Build | |
run: yarn build | |
- name: Get code coverage | |
run: c8 -r lcov yarn test -s | |
- name: SonarCloud Analysis | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |