Enhance SubmodelDescriptor and Shell Descriptors JSON deserialization… #664
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: .NET | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - 'main' | |
| - 'develop' | |
| - 'release/**' | |
| - 'hotfix/**' | |
| push: | |
| branches: | |
| - 'main' | |
| - 'develop' | |
| - 'release/**' | |
| - 'hotfix/**' | |
| permissions: | |
| contents: read | |
| env: | |
| BUILD_CONFIGURATION: "Release" | |
| SOLUTION_PATH: source/AAS.TwinEngine.DataEngine.sln | |
| TEST_PROJECT: source/AAS.TwinEngine.DataEngine.UnitTests/AAS.TwinEngine.DataEngine.UnitTests.csproj | |
| MODULE_TEST_PROJECT: source/AAS.TwinEngine.DataEngine.ModuleTests/AAS.TwinEngine.DataEngine.ModuleTests.csproj | |
| jobs: | |
| build-test: | |
| name: Build & Test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| checks: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0 | |
| with: | |
| dotnet-version: "8.0.x" | |
| - name: Restore | |
| run: dotnet restore ${{ env.SOLUTION_PATH }} --locked-mode | |
| - name: Build | |
| run: dotnet build ${{ env.SOLUTION_PATH }} --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore | |
| - name: Run Unit Tests | |
| run: dotnet test ${{ env.TEST_PROJECT }} --configuration Release --no-build --logger "trx;LogFileName=unit_test_results.trx" --collect:"XPlat Code Coverage" --settings source/coverlet.runsettings | |
| - name: Run Module Tests | |
| run: dotnet test ${{ env.MODULE_TEST_PROJECT }} --configuration Release --no-build --logger "trx;LogFileName=module_test_results.trx" --collect:"XPlat Code Coverage" --settings source/coverlet.runsettings | |
| - name: Publish Test Results | |
| uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 | |
| id: test-results | |
| if: github.event.pull_request.head.repo.fork == false | |
| with: | |
| name: Test Results (Unit & Module) | |
| path: "**/*_test_results.trx" | |
| reporter: dotnet-trx | |
| - name: Combine Reports (Test Results) | |
| if: github.event.pull_request.head.repo.fork == false | |
| run: | | |
| echo "# Test & Coverage Report" > results.md | |
| echo "" >> results.md | |
| echo "## Test Results Summary" >> results.md | |
| echo "" >> results.md | |
| echo "| Metric | Count |" >> results.md | |
| echo "|--------|-------|" >> results.md | |
| echo "| ✅ Passed | ${{ steps.test-results.outputs.passed }} |" >> results.md | |
| echo "| ❌ Failed | ${{ steps.test-results.outputs.failed }} |" >> results.md | |
| echo "| ⏭️ Skipped | ${{ steps.test-results.outputs.skipped }} |" >> results.md | |
| echo "" >> results.md | |
| echo "[View Detailed Test Results](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> results.md | |
| echo "" >> results.md | |
| echo "---" >> results.md | |
| echo "" >> results.md | |
| - name: Code Coverage Report - Unit Tests | |
| if: github.event.pull_request.head.repo.fork == false | |
| uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0 | |
| with: | |
| filename: "source/AAS.TwinEngine.DataEngine.UnitTests/TestResults/*/coverage.cobertura.xml" | |
| badge: false | |
| fail_below_min: true | |
| format: markdown | |
| hide_branch_rate: false | |
| hide_complexity: false | |
| indicators: true | |
| output: both | |
| thresholds: "80 80" | |
| - name: Combine Reports (Unit Test Coverage Results) | |
| if: github.event.pull_request.head.repo.fork == false | |
| run: | | |
| echo "## Code Coverage" >> results.md | |
| echo "" >> results.md | |
| echo "### Unit Tests Coverage" >> results.md | |
| cat code-coverage-results.md >> results.md | |
| echo "" >> results.md | |
| - name: Code Coverage Report - Module Tests | |
| if: github.event.pull_request.head.repo.fork == false | |
| uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0 | |
| with: | |
| filename: "source/AAS.TwinEngine.DataEngine.ModuleTests/TestResults/*/coverage.cobertura.xml" | |
| badge: false | |
| fail_below_min: false | |
| format: markdown | |
| hide_branch_rate: false | |
| hide_complexity: false | |
| indicators: true | |
| output: both | |
| - name: Combine Reports (Module Test Coverage Results) | |
| if: github.event.pull_request.head.repo.fork == false | |
| run: | | |
| echo "### Module Tests Coverage" >> results.md | |
| cat code-coverage-results.md >> results.md | |
| - name: Add PR Comment | |
| if: github.event.pull_request.head.repo.fork == false | |
| uses: marocchino/sticky-pull-request-comment@0ea0beb66eb9baf113663a64ec522f60e49231c0 # v3.0.4 | |
| with: | |
| recreate: true | |
| path: results.md | |
| - name: Upload TRX as artifact | |
| if: always() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: dotnet-test-results | |
| path: "**/*_test_results.trx" | |
| - name: Upload Code Coverage as artifact | |
| if: always() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: dotnet-code-coverage | |
| path: "**/coverage.cobertura.xml" |