Skip to content

ci: use Python 3.12 in Xcode workflows and exclude Source/Data from Swift/C++ CI - #721

Merged
1 commit merged into
masterfrom
ci/python_setup
Nov 1, 2025
Merged

ci: use Python 3.12 in Xcode workflows and exclude Source/Data from Swift/C++ CI#721
1 commit merged into
masterfrom
ci/python_setup

Conversation

@tianjianjiang

@tianjianjiang tianjianjiang commented Oct 26, 2025

Copy link
Copy Markdown
Member

User description

Fixes Python 3.9 compatibility issues with PEP 604 union syntax by using Python 3.12 in CI workflows.


PR Type

Enhancement, Other


Description

  • Add Python 3.12 to CI workflows

  • Exclude Source/Data from Swift/C++ CI

  • Upgrade GitHub Actions to latest major versions

  • Keep CodeQL and Xcode CI paths in sync


Diagram Walkthrough

flowchart LR
  W1["codeql.yml workflow"] -- "setup Python 3.12; update checkout; exclude Source/Data" --> CI["CI improvements"]
  W2["xcode-latest CI workflow"] -- "setup Python 3.12; update actions; exclude Source/Data" --> CI
Loading

File Walkthrough

Relevant files
Enhancement
codeql.yml
CodeQL: set up Python 3.12 and refine scope                           

.github/workflows/codeql.yml

  • Exclude Source/Data/** from triggers
  • Upgrade checkout to actions/checkout@v5
  • Add Python 3.12 via actions/setup-python@v6
+8/-1     
continuous-integration-workflow-xcode-latest.yml
Xcode CI: add Python 3.12 and update actions                         

.github/workflows/continuous-integration-workflow-xcode-latest.yml

  • Exclude Source/Data/** from triggers
  • Upgrade checkout to v5 and commit-comment to v4
  • Add Python 3.12 via actions/setup-python@v6
  • Minor formatting cleanup (newline)
+8/-3     

Copilot AI review requested due to automatic review settings October 26, 2025 13:23
@gemini-code-assist

This comment was marked as off-topic.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates CI workflows to use Python 3.12 to resolve PEP 604 union syntax compatibility issues, and excludes Source/Data/** from Swift/C++ CI triggers since changes to dictionary data don't require rebuilding the Swift or C++ code.

  • Updates Python version from implicit 3.9 to explicit 3.12 in Xcode and CodeQL workflows
  • Adds paths-ignore filters to skip CI runs when only Source/Data/** changes
  • Bumps GitHub Actions versions to latest (checkout@v5, setup-python@v6, commit-comment@v4)

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/continuous-integration-workflow-xcode-latest.yml Adds Python 3.12 setup, excludes Source/Data/**, and updates action versions
.github/workflows/codeql.yml Adds Python 3.12 setup and excludes Source/Data/** from triggers

@github-actions

github-actions Bot commented Oct 26, 2025

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit fc97b69)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

719 - Partially compliant

Compliant requirements:

  • Ensure CI uses Python 3.12 to align with modernization.

Non-compliant requirements:

  • Modernize the Python codebase to Python 3.12+.
  • Adopt type hints and clean architecture across Python code.

Requires further human verification:

  • Verify all Python modules in the repository are updated to 3.12+ syntax and type hints.
  • Validate runtime compatibility on developer environments beyond CI.
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Workflow Paths

The negative path '!Source/Data/**' is added; confirm it properly excludes only Swift/C++ code in that folder without suppressing desired CodeQL coverage or other language scanning.

    - '!Source/Data/**'

pull_request:
  branches: [ "master" ]
  paths:
    - '**/*.swift'
    - '**/*.cpp'
    - '**/*.mm'
    - '**/*.m'
    - '**/*.h'
    - '*.xcodeproj/**'
    - '*.xcworkspace/**'
    - '.github/workflows/codeql.yml'
    - '!Source/Data/**'
Python Setup Placement

Python 3.12 is set up, but no explicit usage step is shown in this workflow; verify any Python-based tooling or scripts invoked by Xcode CI rely on this version and PATH resolution on macOS runners.

- uses: actions/checkout@v5
- uses: actions/setup-python@v6
  with:
    python-version: '3.12'
Action Upgrade

Upgrading commit-comment action to v4 may change permissions or defaults; ensure required permissions (contents: write) are granted and that 'body-path' still behaves as expected.

uses: peter-evans/commit-comment@v4
with:
  body-path: 'codecov_comment.md'

@github-actions

This comment was marked as resolved.

@tianjianjiang
tianjianjiang requested review from a team, Copilot, lukhnos, mjhsieh and zonble October 26, 2025 13:25

This comment was marked as off-topic.

@tianjianjiang
tianjianjiang removed request for a team, lukhnos, mjhsieh and zonble October 26, 2025 13:28
@tianjianjiang
tianjianjiang marked this pull request as draft October 26, 2025 13:28
@tianjianjiang
tianjianjiang marked this pull request as ready for review October 27, 2025 07:00
@github-actions

This comment was marked as resolved.

@tianjianjiang
tianjianjiang requested review from a team, Copilot, lukhnos, mjhsieh and zonble October 27, 2025 07:02

This comment was marked as off-topic.

@zonble

zonble commented Oct 27, 2025

Copy link
Copy Markdown
Contributor

@tianjianjiang The PR is blocked by policy. Please sign your commits. Thanks!

@tianjianjiang

Copy link
Copy Markdown
Member Author

@tianjianjiang The PR is blocked by policy. Please sign your commits. Thanks!

@zonble Sorry it happened again (when Claude Code committed for me).

@tianjianjiang
tianjianjiang force-pushed the ci/python_setup branch 3 times, most recently from 223c44a to d77f4c7 Compare November 1, 2025 08:43
@zonble zonble closed this pull request by merging all changes into master in ef29e53 Nov 1, 2025
zonble added a commit to zonble/McBopomofo that referenced this pull request Nov 1, 2025
ci: use Python 3.12 in Xcode workflows and exclude Source/Data from Swift/C++ CI
@tianjianjiang
tianjianjiang deleted the ci/python_setup branch November 1, 2025 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants