Skip to content

Commit ae85c19

Browse files
committed
ci: verify OpenCLI subprocess contracts on macOS and Windows
1 parent 848a7d1 commit ae85c19

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

‎.github/workflows/contracts.yml‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,58 @@ jobs:
135135
target/surefire-reports
136136
target/site/jacoco
137137
if-no-files-found: error
138+
139+
process-platform:
140+
name: Subprocess contracts (${{ matrix.os }})
141+
if: github.ref_name == 'feature/REQ-20261118-wandl-opencli-contracts-20'
142+
strategy:
143+
fail-fast: false
144+
matrix:
145+
os: [macos-latest, windows-latest]
146+
runs-on: ${{ matrix.os }}
147+
timeout-minutes: 15
148+
defaults:
149+
run:
150+
shell: bash
151+
steps:
152+
- uses: actions/checkout@v7
153+
- uses: actions/setup-java@v5
154+
with:
155+
distribution: temurin
156+
java-version: '17'
157+
cache: maven
158+
- uses: actions/setup-python@v7
159+
with:
160+
python-version: '3.13'
161+
- name: Exercise real subprocess contracts
162+
run: |
163+
mkdir -p platform-evidence
164+
java -version > platform-evidence/java.txt 2>&1
165+
mvn -version > platform-evidence/maven.txt 2>&1
166+
result=0
167+
mvn -B --no-transfer-progress \
168+
-Dtest=OpenCliArgvContractTest,OpenCliStructuredArgvContractTest,OpenCliProcessContractTest,OpenCliProcessBoundaryTest \
169+
test > platform-evidence/maven.log 2>&1 || result=$?
170+
tail -100 platform-evidence/maven.log
171+
python scripts/contract_report.py \
172+
--reports target/surefire-reports \
173+
--head "$(git rev-parse HEAD)" \
174+
--branch "$GITHUB_REF_NAME" \
175+
--java-version-file platform-evidence/java.txt \
176+
--maven-version-file platform-evidence/maven.txt \
177+
--exit-code "$result" \
178+
--suite argv=io.github.easy4j.opencli.contract.OpenCliArgvContractTest \
179+
--suite argv=io.github.easy4j.opencli.contract.OpenCliStructuredArgvContractTest \
180+
--suite process=io.github.easy4j.opencli.contract.OpenCliProcessContractTest \
181+
--suite process=io.github.easy4j.opencli.contract.OpenCliProcessBoundaryTest \
182+
--output platform-evidence/report.json
183+
exit "$result"
184+
- name: Upload platform subprocess evidence
185+
if: always()
186+
uses: actions/upload-artifact@v7
187+
with:
188+
name: subprocess-${{ matrix.os }}-${{ github.sha }}
189+
path: |
190+
platform-evidence
191+
target/surefire-reports
192+
if-no-files-found: error

0 commit comments

Comments
 (0)