Skip to content

Commit b97c32d

Browse files
Ahmed Mustafaclaude
andcommitted
fix(ci): Fix GitHub Actions workflow timeout and permissions issues
Root cause analysis: 1. Jobs exceeded 6-hour timeout due to recursive test execution 2. test-reporter action lacked necessary permissions Fixes applied: ✅ Add reasonable timeout-minutes to all jobs (10-30 minutes) ✅ Add permissions block (contents:read, checks:write, pull-requests:write) ✅ Exclude Demo projects from test execution with filter ✅ Add timeout to test step specifically (10 minutes) Changes: - build job: 30-minute timeout + permissions - test step: 10-minute timeout + filter out Demo projects - code-quality job: 15-minute timeout - package job: 15-minute timeout - publish-demo job: 15-minute timeout The filter 'FullyQualifiedName!~Demo' prevents: - TestingServiceDemo from running real tests during CI - RealTestExecutionDemo from executing actual dotnet test commands - Recursive/circular test execution scenarios This ensures CI completes in reasonable time while still running all actual unit and integration tests. 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent e7d6c59 commit b97c32d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ jobs:
1515
build:
1616
name: Build and Test
1717
runs-on: ${{ matrix.os }}
18+
timeout-minutes: 30
19+
permissions:
20+
contents: read
21+
checks: write
22+
pull-requests: write
1823
strategy:
1924
matrix:
2025
os: [ubuntu-latest, windows-latest, macos-latest]
@@ -42,7 +47,8 @@ jobs:
4247
run: dotnet build ${{ env.SOLUTION_FILE }} --configuration ${{ matrix.configuration }} --no-restore
4348

4449
- name: Run tests
45-
run: dotnet test ${{ env.SOLUTION_FILE }} --configuration ${{ matrix.configuration }} --no-build --verbosity normal --logger "trx;LogFileName=test-results.trx"
50+
run: dotnet test ${{ env.SOLUTION_FILE }} --configuration ${{ matrix.configuration }} --no-build --verbosity normal --logger "trx;LogFileName=test-results.trx" --filter "FullyQualifiedName!~Demo"
51+
timeout-minutes: 10
4652

4753
- name: Upload test results
4854
uses: actions/upload-artifact@v4
@@ -62,6 +68,7 @@ jobs:
6268
code-quality:
6369
name: Code Quality Analysis
6470
runs-on: ubuntu-latest
71+
timeout-minutes: 15
6572

6673
steps:
6774
- name: Checkout code
@@ -86,6 +93,7 @@ jobs:
8693
package:
8794
name: Create NuGet Packages
8895
runs-on: ubuntu-latest
96+
timeout-minutes: 15
8997
needs: [build, code-quality]
9098
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
9199

@@ -119,6 +127,7 @@ jobs:
119127
publish-demo:
120128
name: Publish Sample Applications
121129
runs-on: ubuntu-latest
130+
timeout-minutes: 15
122131
needs: build
123132
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
124133

0 commit comments

Comments
 (0)