Add submodule mpi #222
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: Build and deploy wheel | |
| on: | |
| # Trigger the workflow on all pushes, except on tag creation | |
| push: | |
| branches: | |
| - '**' | |
| tags-ignore: | |
| - '**' | |
| # Trigger the workflow on all pull requests | |
| pull_request: ~ | |
| # Allow workflow to be dispatched on demand | |
| workflow_dispatch: ~ | |
| jobs: | |
| pre-check: | |
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: echo "Condition met, proceeding with workflow." | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} for ${{ matrix.python }} | |
| runs-on: ${{ matrix.os }} | |
| needs: pre-check # This job won't start if 'pre-check' is skipped | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - ubuntu-24.04-arm | |
| - macos-15-intel # x86 | |
| - macos-latest # arm | |
| python: ["cp310", "cp311", "cp312", "cp313", "cp314"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install cibuildwheel | |
| run: python -m pip install cibuildwheel==3.3.1 | |
| - name: Build wheels | |
| run: | | |
| if [ "$(uname -s)" = Darwin ]; then | |
| export MACOSX_DEPLOYMENT_TARGET="$(sw_vers -productVersion | awk -F. '{print $1 ".0"}')" | |
| fi | |
| python -m cibuildwheel --output-dir dist | |
| env: | |
| # Wheel version settings | |
| CIBW_BUILD: ${{matrix.python}}-* | |
| CIBW_SKIP: pp* *musllinux* | |
| # Linux archs | |
| CIBW_ARCHS_LINUX: ${{ fromJSON('["x86_64", "aarch64"]')[matrix.os == 'ubuntu-24.04-arm'] }} # poor man ternary https://github.com/orgs/community/discussions/25725#discussioncomment-3248924 | |
| # MacOS archs | |
| CIBW_ARCHS_MACOS: ${{ fromJSON('["arm64", "x86_64"]')[matrix.os == 'macos-15-intel'] }} | |
| # General | |
| CIBW_TEST_REQUIRES: -r requirements-dev.txt | |
| CIBW_TEST_COMMAND: pytest -v {project}/tests | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: wheel-${{matrix.python}}-${{ matrix.os }} | |
| path: ./dist/*.whl | |
| build_sdist: | |
| name: Build sdist | |
| runs-on: ubuntu-latest | |
| needs: pre-check # This job won't start if 'pre-check' is skipped | |
| steps: | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| - uses: actions/checkout@v6 | |
| - name: Install requirements | |
| run: python -m pip install -r requirements-dev.txt | |
| - name: Make sdist | |
| run: python -m build --sdist --outdir dist/ | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: sdist | |
| path: ./dist/*.tar.gz | |
| upload-testpypi: | |
| name: Upload wheels to TestPyPI | |
| needs: [build_wheels, build_sdist] | |
| runs-on: ubuntu-latest | |
| # Only run for pushes to master (not PRs, not workflow_dispatch) | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
| steps: | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Publish to test.pypi.org | |
| if: ${{ github.event_name == 'push' }} | |
| uses: pypa/gh-action-pypi-publish@v1.13.0 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.TESTPYPI_DEPLOY_TOKEN }} | |
| repository-url: https://test.pypi.org/legacy/ |