test(coverage): uplift Reactor.dll line coverage 79.52% → 80.79% #687
Workflow file for this run
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 | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| jobs: | |
| changes: | |
| name: Detect changes | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| outputs: | |
| non-md: ${{ steps.filter.outputs.non-md }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Detect non-Markdown changes | |
| id: filter | |
| env: | |
| BASE_SHA: ${{ github.event.pull_request.base.sha }} | |
| HEAD_SHA: ${{ github.event.pull_request.head.sha }} | |
| PUSH_BEFORE: ${{ github.event.before }} | |
| PUSH_SHA: ${{ github.sha }} | |
| run: | | |
| set +e | |
| ZERO_SHA="0000000000000000000000000000000000000000" | |
| if [ -n "$BASE_SHA" ] && [ -n "$HEAD_SHA" ]; then | |
| # Three-dot mirrors GitHub's PR diff (merge-base..head). | |
| files=$(git diff --name-only "$BASE_SHA...$HEAD_SHA") | |
| rc=$? | |
| elif [ -n "$PUSH_BEFORE" ] && [ -n "$PUSH_SHA" ] && [ "$PUSH_BEFORE" != "$ZERO_SHA" ]; then | |
| files=$(git diff --name-only "$PUSH_BEFORE" "$PUSH_SHA") | |
| rc=$? | |
| else | |
| echo "No valid diff range; defaulting to non-md=true" | |
| echo "non-md=true" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| if [ "$rc" -ne 0 ]; then | |
| echo "git diff failed; defaulting to non-md=true" | |
| echo "non-md=true" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| echo "Changed files:" | |
| echo "$files" | |
| if [ -z "$files" ] || echo "$files" | grep -qv '\.md$'; then | |
| echo "non-md=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "non-md=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| unit-tests: | |
| name: Unit Tests | |
| needs: changes | |
| if: needs.changes.outputs.non-md == 'true' | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore | |
| run: dotnet restore tests/Reactor.Tests/Reactor.Tests.csproj -p:Platform=x64 | |
| - name: Test | |
| run: dotnet test tests/Reactor.Tests/Reactor.Tests.csproj --no-restore -p:Platform=x64 --logger "console;verbosity=normal" | |
| integration-tests: | |
| name: Integration Tests | |
| needs: changes | |
| if: needs.changes.outputs.non-md == 'true' | |
| runs-on: windows-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore | |
| run: dotnet restore Reactor.slnx | |
| - name: Test | |
| run: dotnet test tests/Reactor.IntegrationTests/Reactor.IntegrationTests.csproj --no-restore --logger "console;verbosity=normal" | |
| selftests: | |
| name: Selftests | |
| needs: changes | |
| if: needs.changes.outputs.non-md == 'true' | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore | |
| run: dotnet restore tests/Reactor.SelfTests/Reactor.SelfTests.csproj -p:Platform=x64 | |
| - name: Test | |
| run: dotnet test tests/Reactor.SelfTests/Reactor.SelfTests.csproj --no-restore -p:Platform=x64 --logger "console;verbosity=normal" | |
| build-solution: | |
| name: Build solution | |
| needs: changes | |
| if: needs.changes.outputs.non-md == 'true' | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore | |
| run: dotnet restore Reactor.slnx | |
| - name: Build | |
| run: dotnet build Reactor.slnx --no-restore --configuration Release | |
| docs-compile: | |
| name: Docs compile | |
| needs: changes | |
| if: needs.changes.outputs.non-md == 'true' | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Compile docs | |
| run: dotnet run --project src/Reactor.Cli -- docs compile --no-screenshots --ci |