Feature/lots #86
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: PR Build and Test | |
| on: | |
| pull_request: | |
| jobs: | |
| build-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore CryptoTracker.slnx | |
| - name: Build | |
| run: dotnet build CryptoTracker.slnx --configuration Release --no-restore | |
| - name: Test | |
| run: | | |
| dotnet test CryptoTracker.slnx --configuration Release \ | |
| --logger "trx;LogFileName=test_results.trx" \ | |
| --results-directory TestResults \ | |
| --verbosity normal | |
| continue-on-error: true | |
| - name: Summarize test results | |
| if: always() | |
| run: | | |
| FAILED=$(grep -o 'outcome="Failed"' TestResults/test_results.trx | wc -l || true) | |
| PASSED=$(grep -o 'outcome="Passed"' TestResults/test_results.trx | wc -l || true) | |
| TOTAL=$((FAILED+PASSED)) | |
| echo "### Unit Test Results" >> $GITHUB_STEP_SUMMARY | |
| echo "Total: $TOTAL" >> $GITHUB_STEP_SUMMARY | |
| echo "Passed: $PASSED" >> $GITHUB_STEP_SUMMARY | |
| echo "Failed: $FAILED" >> $GITHUB_STEP_SUMMARY | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: TestResults/test_results.trx |