name: "macOS CI pipeline setup steps" description: "Common setup steps for macOS CI pipelines" inputs: platform_machine: required: true type: string python_version: required: false type: string default: "3.14" node_version: required: false type: string default: "24.x" java_version: required: false type: string default: "17" xcode_version: required: false type: string default: "16" use_cache: required: false type: boolean default: false runs: using: "composite" steps: - name: Use Python uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: ${{ inputs.python_version }} - name: Verify machine architecture shell: python run: | import platform print(f"Running on {platform.machine()}") assert platform.machine().lower() == "${{ inputs.platform_machine}}", "This job expects to be run on an ${{ inputs.platform_machine}} machine." - name: Use Node.js uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 with: node-version: ${{ inputs.node_version }} - name: Install coreutils and ninja shell: bash run: brew install coreutils ninja - name: Install Java uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 with: distribution: "temurin" java-version: ${{ inputs.java_version }} - name: Use Xcode ${{ inputs.xcode_version }} shell: bash run: | XCODE_DEVELOPER_DIR="/Applications/Xcode_${{ inputs.xcode_version }}.app/Contents/Developer" sudo xcode-select --switch "${XCODE_DEVELOPER_DIR}" - name: Install python dependencies shell: bash working-directory: ${{ github.workspace }} run: | python -m pip install --upgrade pip python -m pip install -r requirements-dev.txt