Implements SBCS instruction #73
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: Run Tests | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| workflow_dispatch: | |
| jobs: | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: 17 | |
| distribution: 'zulu' | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.100' | |
| - name: Install SonarCloud scanner | |
| run: dotnet tool install --global dotnet-sonarscanner | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Begin SonarQube Analysis | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
| run: | | |
| dotnet sonarscanner begin /k:"begeistert_RP2040Sharp" \ | |
| /o:"begeistert" \ | |
| /d:sonar.host.url="${SONAR_HOST_URL}" \ | |
| /d:sonar.token="${SONAR_TOKEN}" \ | |
| /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" \ | |
| /d:sonar.exclusions="tests/**" \ | |
| /d:sonar.scanner.scanAll=false | |
| - name: Build | |
| run: dotnet build --configuration Release --no-restore | |
| - name: Execute xUnit Tests | |
| run: | | |
| dotnet test --configuration Release --no-build --verbosity normal \ | |
| --collect:"XPlat Code Coverage" \ | |
| -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover | |
| - name: End SonarQube Analysis | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: dotnet sonarscanner end /d:sonar.login="${SONAR_TOKEN}" |