Skip to content

ci: Windows の結合テストを com0com と serdevmock で流す - #32

Merged
tomio2480 merged 10 commits into
mainfrom
claude/ci-windows-integration-8d35e4
Nov 16, 2026
Merged

tomio2480 merged 10 commits into
mainfrom
claude/ci-windows-integration-8d35e4

Conversation

@tomio2480

Copy link
Copy Markdown
Owner

push 前にセルフレビューと /security-review を実施しました。/security-review では、信頼度 8 以上の指摘はありませんでした。

概要

Windows の結合テストを GitHub Actions で流すワークフロー integration-windows.yml を追加します。
com0com で COM10 と COM11 の対を作り、COM11 でエコーモードの serdevmock を動かします。
COM10 で integration グループ(3 件)を流したあと serdevmock を止め、windows-idle-port グループ(2 件)を流します。

変更内容

  • .github/workflows/integration-windows.yml を追加しました。
    • 実行の機会は macOS 版に倣います。手動、毎週月曜 03:00(日本時間)、関係するパスを変えた PR の 3 つです。
    • 関係するパスは、ワークフロー、tests/Integration/**、tests/fixtures/{serdevmock,windows}/**、src/PhpSerial/Platform/Windows*.php です。
    • PHP 8.5 で FFI を有効にし、php --ri ffi で有効化を確かめます。FFI が無効だと fopen 版に切り替わり、FFI 実装を試験しないまま通るためです。
    • 権限は contents: read のみです。Actions は full SHA でピンしています。
  • tests/Integration/start-serdevmock.ps1 と stop-serdevmock.ps1 を追加しました。手元でも使えます。
  • docs/INTEGRATION_TESTING.md の「CI での扱い」と、README の結合テストの記述を更新しました。

com0com の入れ方

  1. SourceForge から com0com-3.0.0.0-i386-and-x64-signed.zip を取得します。SHA256 が 6e5d4359… と一致しなければ止めます。
  2. インストーラーの署名者証明書(CyberCircuits)を LocalMachine の TrustedPublisher に登録します。登録しないと、ドライバー導入の確認ダイアログで止まります(3 分でタイムアウトしました)。
  3. インストーラーを /S で実行し、setupc.exe --silent install PortName=COM10 PortName=COM11 で対を作ります。

ホストランナーは Windows Server 2025 で、Secure Boot が無効でした。このため 2016 年の証明書で署名されたドライバーも読み込めます。

所要時間の実測

項目 時間
ジョブ全体(待ち 3 秒を含まない) 約 57 秒
com0com の取得と導入 約 9 秒
serdevmock の起動と integration 3 件 約 4 秒
windows-idle-port 2 件 約 2 秒

1 分ほどで終わるため、Linux と同じく push と PR ごとに流す選択肢もあります。今回は指示どおり macOS 版に合わせました。

途中で分かったこと

  • Windows のランナーは、ステップ内で起動したプロセスをステップの終わりに止めます。このため serdevmock の起動・試験・停止を 1 つのステップにまとめました。分けると試験の時点で serdevmock が止まっており、エコーが返りません。
  • serdevmock は日本語のメッセージを出すため、出力をファイルへ向けると cp1252 で落ちます。起動スクリプトで PYTHONIOENCODING=utf-8 を指定しています。
  • PHP 8.5(Windows)の FFI では、DWORD 型のビットフィールドがオフセット 0(DCBlength)に重なって読み書きされました。今の WindowsFFI はビットフィールドに触れないため影響しません。ただし今後 fBinary やフロー制御を設定するときは注意が要ります。

履歴について

ブランチには試行用と診断用のコミット(「TEMP」「試行、後で削除」)が残っています。最終のツリーには診断用のファイルや一時トリガーは残っていません。squash マージを想定しています。

確認

  • ブランチへの push で Windows ジョブが成功しました(integration 3 件、windows-idle-port 2 件。skip なし)。
  • src/ は変更していません。

🤖 Generated with Claude Code

tomio2480 and others added 10 commits November 16, 2026 18:03
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
診断用のワークフローとスクリプトは役目を終えたため消す。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Windows のランナーはステップ内で起動したプロセスをステップの終わりに止めるため。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
文書を実際の構成(1 ステップでの起動・試験・停止、発行元の登録、FFI の確認)に合わせる。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c690dd09-79fd-4ef8-a7c1-086cdd56dbbd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

Copy link
Copy Markdown

Lint summary

ツール この PR の差分 リポジトリ全体
markdownlint 0 0
textlint 0 0

検査対象: Merge 4be4575 into 23e08ba(base: 23e08ba)

指摘はありません.

Actions run: https://github.com/tomio2480/php-serial/actions/runs/43890827617/attempts/1

@tomio2480

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T17:38:28.444008Z 4be4575 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 4be4575b7b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@tomio2480
tomio2480 marked this pull request as ready for review November 16, 2026 17:39
@tomio2480
tomio2480 merged commit 94f22fc into main Nov 16, 2026
24 checks passed
@tomio2480
tomio2480 deleted the claude/ci-windows-integration-8d35e4 branch November 16, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant