7171 name : Integration Tests (Testcontainers + PostGIS)
7272 runs-on : ubuntu-latest
7373 needs : build
74+ outputs :
75+ needs_integration : ${{ steps.changes.outputs.integration }}
7476 services :
7577 # Testcontainers will manage containers, but we need Docker available
7678 docker :
7981 steps :
8082 - uses : actions/checkout@v4
8183
84+ - name : Detect Integration Test Scope
85+ id : changes
86+ uses : dorny/paths-filter@v3
87+ with :
88+ filters : |
89+ integration:
90+ - 'src/**'
91+ - 'tests/**'
92+ - 'docker/**'
93+ - 'Dockerfile'
94+ - 'docker-compose.yml'
95+ - '**/*.csproj'
96+ - 'Directory.Build.props'
97+ - 'Honua.sln'
98+ - '.github/workflows/**'
99+ - 'scripts/**'
100+
82101 - name : Setup .NET
83102 uses : actions/setup-dotnet@v4
84103 with :
88107 run : dotnet restore Honua.sln
89108
90109 - name : Run Integration Tests
110+ if : steps.changes.outputs.integration == 'true'
91111 run : |
92112 dotnet test Honua.sln \
93113 --no-restore \
@@ -101,7 +121,7 @@ jobs:
101121
102122 - name : Upload Test Results
103123 uses : actions/upload-artifact@v4
104- if : always()
124+ if : steps.changes.outputs.integration == 'true'
105125 with :
106126 name : integration-test-results
107127 path : tests/TestResults/
@@ -152,6 +172,7 @@ jobs:
152172
153173 - name : Download Integration Test Results
154174 uses : actions/download-artifact@v4
175+ if : needs.test-integration.outputs.needs_integration == 'true'
155176 with :
156177 name : integration-test-results
157178 path : ./coverage/integration
@@ -193,16 +214,14 @@ jobs:
193214 BRANCH_COVERAGE=$(grep -oP 'Branch coverage: \K[\d.]+' ./coverage/report/Summary.txt || echo "0")
194215 echo "Branch coverage: ${BRANCH_COVERAGE}%"
195216
196- # Phase 0: Lower thresholds for infrastructure setup phase
197- # TODO: Restore to 80%/70% once we have more implementation
198- # Temporarily reduced to 30% for Issue #3 - PostgresFeatureStore has excellent coverage
199- # but overall project coverage low due to greenfield nature
200- if (( $(echo "$COVERAGE < 30" | bc -l) )); then
201- echo "::error::Coverage ${COVERAGE}% is below 30% threshold"
217+ # Phase 0-1: Staged thresholds to keep velocity while increasing coverage
218+ # TODO: Restore to 80%/70% once core FeatureServer endpoints are complete
219+ if (( $(echo "$COVERAGE < 40" | bc -l) )); then
220+ echo "::error::Coverage ${COVERAGE}% is below 40% threshold"
202221 exit 1
203222 fi
204- if (( $(echo "$BRANCH_COVERAGE < 25 " | bc -l) )); then
205- echo "::error::Branch coverage ${BRANCH_COVERAGE}% is below 25 % threshold"
223+ if (( $(echo "$BRANCH_COVERAGE < 30 " | bc -l) )); then
224+ echo "::error::Branch coverage ${BRANCH_COVERAGE}% is below 30 % threshold"
206225 exit 1
207226 fi
208227
0 commit comments