[Perf] Add ti.perf_dispatch #2257
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Mac OS | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: ${{ github.event_name != 'release' }} | |
| jobs: | |
| build_mac: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| MAC_OS_VERSION: [26] | |
| PYTHON_VERSION: ['3.10', '3.11', '3.12', '3.13'] | |
| name: Mac OS Build | |
| runs-on: macos-${{ matrix.MAC_OS_VERSION }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Python check | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.PYTHON_VERSION}} | |
| - name: Set Python CP version | |
| id: set_cp_version | |
| run: | | |
| pip install packaging | |
| cp=$(python -c "from packaging import tags; print(next(tags.sys_tags()).interpreter)") | |
| echo "PYTHON_CP_VERSION=${cp}" | |
| echo "PYTHON_CP_VERSION=${cp}" >> $GITHUB_OUTPUT | |
| - name: Mac OS X prerequisites | |
| run: | | |
| bash .github/workflows/scripts_new/macosx/1_prerequisites.sh | |
| - name: Mac OS X build | |
| run: | | |
| bash .github/workflows/scripts_new/macosx/2_build.sh | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: mac_wheel_${{ matrix.MAC_OS_VERSION }}_${{ steps.set_cp_version.outputs.PYTHON_CP_VERSION }} | |
| path: dist/*.whl | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: mac_cpptests_${{ matrix.MAC_OS_VERSION }}_${{ steps.set_cp_version.outputs.PYTHON_CP_VERSION }} | |
| path: build/gstaichi_cpp_tests | |
| test: | |
| needs: build_mac | |
| name: Test on Mac | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| MAC_OS_VERSION: [26] | |
| PYTHON_VERSION: ['3.10', '3.11', '3.12', '3.13'] | |
| include: | |
| - MAC_OS_VERSION: 15 | |
| PYTHON_VERSION: '3.10' | |
| runs-on: macos-${{ matrix.MAC_OS_VERSION }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Python check | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.PYTHON_VERSION}} | |
| - name: Set Python CP version | |
| id: set_cp_version | |
| run: | | |
| pip install packaging | |
| cp=$(python -c "from packaging import tags; print(next(tags.sys_tags()).interpreter)") | |
| echo "PYTHON_CP_VERSION=${cp}" | |
| echo "PYTHON_CP_VERSION=${cp}" >> $GITHUB_OUTPUT | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: mac_wheel_26_${{ steps.set_cp_version.outputs.PYTHON_CP_VERSION }} | |
| path: dist | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: mac_cpptests_26_${{ steps.set_cp_version.outputs.PYTHON_CP_VERSION }} | |
| path: build | |
| - name: Mac OS X install | |
| run: | | |
| bash .github/workflows/scripts_new/macosx/3_install.sh | |
| - name: Mac OS X test | |
| run: | | |
| bash .github/workflows/scripts_new/macosx/4_test.sh | |
| publish_pypi: | |
| uses: ./.github/workflows/publish_pypi.yml | |
| if: github.event_name == 'release' | |
| needs: test | |
| permissions: | |
| id-token: write | |
| contents: read | |
| concurrency: | |
| # group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}-${{ matrix.PYTHON_CP_VERSION }}-${{ matrix.PYTHON_CP_VERSION != 'cp310' && 'all' || github.sha }}-test | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}-${{ matrix.PYTHON_CP_VERSION }}-test | |
| cancel-in-progress: true | |
| strategy: | |
| matrix: | |
| PYTHON_CP_VERSION: ["cp310", "cp311", "cp312", "cp313"] | |
| MAC_OS_VERSION: [26] | |
| fail-fast: false | |
| with: | |
| artifact_name: mac_wheel_${{ matrix.MAC_OS_VERSION }}_${{ matrix.PYTHON_CP_VERSION }} | |
| secrets: inherit |