Improve Go Aeron tests and coverage #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: build-dotnet | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Detect .NET project | |
| id: detect | |
| run: | | |
| if ls dotnet/*.sln >/dev/null 2>&1 || ls dotnet/*.csproj >/dev/null 2>&1; then | |
| echo "present=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "present=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Set up .NET | |
| if: steps.detect.outputs.present == 'true' | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "8.0.x" | |
| - name: Build | |
| if: steps.detect.outputs.present == 'true' | |
| run: | | |
| if ls dotnet/*.sln >/dev/null 2>&1; then | |
| dotnet build dotnet/*.sln | |
| else | |
| dotnet build dotnet/*.csproj | |
| fi | |
| - name: Test | |
| if: steps.detect.outputs.present == 'true' && hashFiles('dotnet/Epoch.Tests/Epoch.Tests.csproj') != '' | |
| run: dotnet test dotnet/Epoch.Tests/Epoch.Tests.csproj --collect:"XPlat Code Coverage" | |
| - name: Upload coverage | |
| if: steps.detect.outputs.present == 'true' && hashFiles('dotnet/Epoch.Tests/Epoch.Tests.csproj') != '' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: dotnet/Epoch.Tests/TestResults/**/coverage.cobertura.xml | |
| flags: dotnet | |
| fail_ci_if_error: false | |
| - name: Skip (no .NET project yet) | |
| if: steps.detect.outputs.present != 'true' | |
| run: echo "No .NET sources yet." |