test: use FSM event-based WaitUntil in specs to avoid net48 flakiness… #5
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: ci-linux | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| - develop | |
| - feature/* | |
| - release/* | |
| - hotfix/* | |
| tags: | |
| - "*.*.*" | |
| - "*.*.*-*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-test-linux: | |
| name: Build and test (Linux, .NET 8) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| SOLUTION_FILTER: ci.linux.slnf | |
| DOTNET_NOLOGO: true | |
| DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v4 | |
| # setup-dotnet respects global.json automatically | |
| - name: Cache NuGet packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.nuget/packages | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj','**/*.fsproj','**/packages.lock.json','global.json','Directory.Packages.props') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuget- | |
| - name: Restore | |
| run: dotnet restore "$SOLUTION_FILTER" | |
| - name: Build (Release) | |
| run: dotnet build "$SOLUTION_FILTER" --configuration Release --no-restore | |
| - name: Test (Release) - Solution filter | |
| run: dotnet test "$SOLUTION_FILTER" --configuration Release --no-build --logger "trx;LogFileName=test-results.trx" --results-directory ./TestResults | |
| - name: Test (Release) - TA.Utils.Specifications (net8.0) | |
| run: dotnet test "TA.Utils.Specifications/TA.Utils.Specifications.csproj" --framework net8.0 --configuration Release --logger "trx;LogFileName=test-results-specs.trx" --results-directory ./TestResults | |
| - name: Publish test report | |
| if: always() | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| with: | |
| files: | | |
| ./TestResults/*.trx | |
| check_name: Unit Test Results (Linux) | |
| comment_mode: off | |
| report_suite_logs: any | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-linux | |
| path: | | |
| ./TestResults/*.trx | |
| if-no-files-found: warn | |
| - name: Attach test summary to job | |
| if: always() | |
| run: | | |
| echo "## Test artefacts" >> $GITHUB_STEP_SUMMARY | |
| echo "- See the 'Unit Test Results (Linux)' check for details" >> $GITHUB_STEP_SUMMARY |