ITADN

Add write_macOS_CPUs.md job to automatically merge macOS runner information

#28Pull RequestCopilot 创建于 2025-08-28已合并
C
Copilotcommented
This PR adds a new job `write_macOS_CPUs.md` to the `.github/workflows/macOS_on_demand.yml` workflow that automatically consolidates macOS runner information from all matrix jobs into a single table. ## Problem The existing workflow creates individual `macOS_CPUs.md` files for each macOS version in the matrix (macos-13, macos-14, macos-15, macos-latest), but there's no automated way to combine these into a unified view. This makes it difficult to see all macOS runner configurations at a glance. ## Solution The new job: 1. **Depends on the matrix job completion** - Uses `needs: macOS` to run only after all matrix jobs finish successfully 2. **Runs on ubuntu-latest** - Cost-efficient runner for artifact processing 3. **Downloads all artifacts** - Uses pattern `macOS_CPUs-*` to collect all matrix outputs 4. **Intelligently merges data** - Python script that: - Recursively finds all `macOS_CPUs.md` files in downloaded artifacts - Extracts data rows while preserving table structure - Deduplicates entries and sorts alphabetically - Only updates `macOS_CPUs.md` if content actually differs 5. **Provides transparency** - Uploads both the final merged file and intermediate combined file ## Example Output After running, `macOS_CPUs.md` will contain a consolidated table like: ```markdown | macOS Version | runner.arch | |--------------|-------------| | macos-13 | X64 | | macos-14 | ARM64 | | macos-15 | ARM64 | | macos-latest | ARM64 | ``` ## Files Changed - **`.github/workflows/macOS_on_demand.yml`** - Added new job with comprehensive processing logic - **`macOS_CPUs.md`** - Created baseline file for comparison (initially empty table) This enables automated updating of macOS CPU information whenever the matrix configuration changes, providing a always up-to-date consolidated view of all macOS runners and their architectures. <!-- START COPILOT CODING AGENT SUFFIX --> *This pull request was created as a result of the following prompt from Copilot chat.* > Add a new job called write_macOS_CPUs.md to the workflow in .github/workflows/macOS_on_demand.yml. This job needs the macOS job, and runs on ubuntu-latest. It uses shell: python to: > - Download all macOS_CPUs-* artifacts and merge all macOS_CPUs.md files into a single table (macOS_CPUs_combined.md), deduplicating and sorting rows. > - Compares the combined table with the local macOS_CPUs.md file. > - If the contents differ, updates macOS_CPUs.md with new contents. > > This enables automated updating of macOS_CPUs.md whenever the per-matrix jobs change their output. <!-- START COPILOT CODING AGENT TIPS --> --- 💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click [here](https://survey3.medallia.com/?EAHeSx-AP01bZqG0Ld9QLQ) to start the survey.
合并状态:已合并 合并于 2025-08-28 关闭于 2025-08-28 0 条评论