dotnet linux #790
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: dotnet linux | |
| on: | |
| push: | |
| branches-ignore: [main] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| - cron: "15 7 * * *" | |
| permissions: {} | |
| jobs: | |
| dotnet-linux: | |
| outputs: | |
| status: ${{ job.status }} | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| senzingsdk-version: [production-v4, staging-v4] | |
| include: | |
| - dotnet-version: "8" | |
| steps: | |
| - name: checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: ${{ matrix.dotnet-version }} | |
| - name: install Senzing SDK | |
| uses: senzing-factory/github-action-install-senzing-sdk@v3 | |
| with: | |
| packages-to-install: "senzingsdk-runtime senzingsdk-setup" | |
| senzingsdk-version: ${{ matrix.senzingsdk-version }} | |
| - name: Build with DotNet | |
| env: | |
| LD_LIBRARY_PATH: "/opt/senzing/er/lib" | |
| run: | | |
| dotnet test Senzing.Sdk.Demo -p:GeneratePackageOnBuild=false | |
| dotnet build -c Release Senzing.Sdk -p:GenerateDocumentationFile=true | |
| - name: Validate tests compile | |
| run: | | |
| dotnet build Senzing.Sdk.Tests | |
| - name: Run DotNet tests | |
| env: | |
| LD_LIBRARY_PATH: "/opt/senzing/er/lib" | |
| run: | | |
| dotnet build Senzing.Sdk.TestHelpers | |
| dotnet test --no-build Senzing.Sdk.Tests --logger trx --collect:"XPlat Code Coverage" | |
| filter=$(date +%F) | |
| results_folder=$(find Senzing.Sdk.Tests/TestResults/ ! -name "*$filter*" -type d -maxdepth 1 | awk -F '/' '{print $NF}' | tr -d '\n') | |
| cp Senzing.Sdk.Tests/TestResults/"$results_folder"/coverage.cobertura.xml ${{ github.workspace }}/coverage.cobertura.${{ matrix.senzingsdk-version }}.xml | |
| - name: Store coverage file | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: coverage.cobertura.${{ matrix.senzingsdk-version }}.xml | |
| path: coverage.cobertura.${{ matrix.senzingsdk-version }}.xml | |
| coverage: | |
| name: Coverage | |
| needs: dotnet-linux | |
| permissions: | |
| pull-requests: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| senzingsdk-version: [production-v4, staging-v4] | |
| uses: senzing-factory/build-resources/.github/workflows/csharp-coverage-comment.yaml@v3 | |
| with: | |
| filename: coverage.cobertura.${{ matrix.senzingsdk-version }}.xml | |
| thresholds: "85 90" | |
| slack-notification: | |
| needs: [dotnet-linux] | |
| if: ${{ always() && contains(fromJSON('["failure", "cancelled"]'), needs.dotnet-linux.outputs.status ) && github.event_name == 'schedule' }} | |
| secrets: | |
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
| uses: senzing-factory/build-resources/.github/workflows/build-failure-slack-notification.yaml@v3 | |
| with: | |
| job-status: ${{ needs.dotnet-linux.outputs.status }} |