Repository navigation
ci: require execution of traced OpenCLI contract methods #195
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: Platform subprocess contracts | |
| on: | |
| push: | |
| branches: [feature/REQ-20261118-wandl-opencli-privacy-30] | |
| permissions: | |
| contents: read | |
| jobs: | |
| process-platform: | |
| name: Subprocess contracts (${{ matrix.os }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, macos-15-intel, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| cache: maven | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: '3.13' | |
| - uses: actions/setup-node@v4 | |
| if: runner.os == 'Windows' | |
| with: | |
| node-version: '22' | |
| - name: Exercise real subprocess contracts | |
| run: | | |
| mkdir -p platform-evidence | |
| if [[ "$RUNNER_OS" == Windows ]]; then | |
| OPENCLI_CONTRACT_NODE_EXECUTABLE="$(node -p 'process.execPath')" | |
| export OPENCLI_CONTRACT_NODE_EXECUTABLE | |
| fi | |
| java -version > platform-evidence/java.txt 2>&1 | |
| bash ./mvnw -version > platform-evidence/maven.txt 2>&1 | |
| result=0 | |
| bash ./mvnw -B --no-transfer-progress \ | |
| -Dtest=OpenCliCapabilityDiscoveryTest,OpenCliCapabilityCommandTest,OpenCliErrorEnvelopeTest,OpenCliBrowserResultTest,OpenCliBrowserEvidenceResultTest,OpenCliDiagnosticsTest,OpenCliInvocationContextTest,OpenCliArgvContractTest,OpenCliStructuredArgvContractTest,OpenCliProcessContractTest,OpenCliProcessBoundaryTest,SubprocessCleanupFaultTest,SubprocessCompletionRaceTest,SubprocessStreamFailureTest,OpenCliWsReverseAgentSessionTest,OpenCliWsCollectRequestsTest,OpenCliRemoteAgentHttpClientTest,OpenCliProcessPrivacyTest,OpenCliArgSupportTest#shouldKeepConversionExceptionAndNestedCausePrivate,SubprocessExecutionSupportTest#shouldKeepNativePathOutOfDefaultHandlerException+legacyOutputStreamsAllowBoundedWritesWithoutChangingExecutionDetails,OpenCliStructuredHelpFixtureTest,OpenCliHelpParserTest,OpenCliArgvToCollectParserFullTest,OpenCliDiagnosticExportTest \ | |
| test > platform-evidence/maven.log 2>&1 || result=$? | |
| tail -100 platform-evidence/maven.log | |
| python scripts/contract_report.py \ | |
| --reports target/surefire-reports \ | |
| --trace openspec/changes/enforce-opencli-branch-contract-parity/evidence/final-requirement-trace.md \ | |
| --head "$(git rev-parse HEAD)" \ | |
| --branch "$GITHUB_REF_NAME" \ | |
| --java-version-file platform-evidence/java.txt \ | |
| --maven-version-file platform-evidence/maven.txt \ | |
| --exit-code "$result" \ | |
| --suite enumeration=io.github.easy4j.opencli.contract.OpenCliHelpParserTest \ | |
| --suite enumeration=io.github.easy4j.opencli.contract.OpenCliStructuredHelpFixtureTest \ | |
| --suite enumeration=io.github.easy4j.opencli.capability.OpenCliCapabilityDiscoveryTest \ | |
| --suite argv=io.github.easy4j.opencli.capability.OpenCliCapabilityCommandTest \ | |
| --suite argv=io.github.easy4j.opencli.contract.OpenCliArgvContractTest \ | |
| --suite argv=io.github.easy4j.opencli.contract.OpenCliStructuredArgvContractTest \ | |
| --suite process=io.github.easy4j.opencli.contract.OpenCliProcessContractTest \ | |
| --suite process=io.github.easy4j.opencli.contract.OpenCliProcessBoundaryTest \ | |
| --suite process=io.github.easy4j.opencli.core.support.SubprocessCleanupFaultTest \ | |
| --suite process=io.github.easy4j.opencli.core.support.SubprocessCompletionRaceTest \ | |
| --suite process=io.github.easy4j.opencli.core.support.SubprocessStreamFailureTest \ | |
| --suite protocol=io.github.easy4j.opencli.remote.OpenCliArgvToCollectParserFullTest \ | |
| --suite protocol=io.github.easy4j.opencli.center.ws.OpenCliWsReverseAgentSessionTest \ | |
| --suite protocol=io.github.easy4j.opencli.center.ws.OpenCliWsCollectRequestsTest \ | |
| --suite protocol=io.github.easy4j.opencli.remote.OpenCliRemoteAgentHttpClientTest \ | |
| --suite process=io.github.easy4j.opencli.core.OpenCliProcessPrivacyTest \ | |
| --suite argv=io.github.easy4j.opencli.core.OpenCliArgSupportTest \ | |
| --suite process=io.github.easy4j.opencli.core.support.SubprocessExecutionSupportTest \ | |
| --suite protocol=io.github.easy4j.opencli.contract.OpenCliErrorEnvelopeTest \ | |
| --suite typed-result=io.github.easy4j.opencli.core.OpenCliDiagnosticExportTest \ | |
| --suite typed-result=io.github.easy4j.opencli.contract.OpenCliBrowserResultTest \ | |
| --suite typed-result=io.github.easy4j.opencli.contract.OpenCliBrowserEvidenceResultTest \ | |
| --suite typed-result=io.github.easy4j.opencli.capability.OpenCliDiagnosticsTest \ | |
| --suite argv=io.github.easy4j.opencli.capability.OpenCliInvocationContextTest \ | |
| --output platform-evidence/report.json | |
| exit "$result" | |
| - name: Verify npm-installed OpenCLI on Windows | |
| if: runner.os == 'Windows' | |
| run: bash scripts/run_installed_contracts.sh bash ./mvnw | |
| - name: Upload platform subprocess evidence | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: subprocess-${{ matrix.os }}-${{ github.sha }} | |
| path: | | |
| platform-evidence | |
| target/surefire-reports | |
| if-no-files-found: error | |
| browser-bridge: | |
| name: Real Browser Bridge (${{ matrix.os }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| cache: maven | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: '3.13' | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24.18.0' | |
| - name: Install the published OpenCLI in the runner's temporary directory | |
| run: npm install --prefix "$RUNNER_TEMP/opencli-browser-cli" --ignore-scripts --no-audit --no-fund @jackwener/opencli@1.8.8 | |
| - name: Exercise the real Chrome extension against the loopback daemon | |
| run: | | |
| python scripts/run_browser_bridge_contracts.py \ | |
| --cli-entry "$RUNNER_TEMP/opencli-browser-cli/node_modules/@jackwener/opencli/dist/src/main.js" \ | |
| --evidence browser-bridge-evidence -- "$(command -v bash)" ./mvnw | |
| - name: Upload real Bridge evidence | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: browser-bridge-${{ matrix.os }}-${{ github.sha }} | |
| path: browser-bridge-evidence | |
| if-no-files-found: error |