Skip to content

Setup mpi4py with action instead. #66

Setup mpi4py with action instead.

Setup mpi4py with action instead. #66

Workflow file for this run

on:
pull_request:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
pypi:
env:
IGNORE_CONDA: true
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-latest]
python-version: ["3.9", "3.10", "3.11"]
fail-fast: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: mpi4py/setup-mpi@v1
- run: |
python3 -m pip install -U pip
- if: ${{ contains(matrix.os, 'ubuntu') }}
run: |
./pr-check.sh
- if: ${{ contains(matrix.os, 'macos') }}
run: |
brew install libomp llvm
export CLANG_PREFIX=$(brew --prefix llvm)
export CC=$CLANG_PREFIX/bin/clang
export CXX=$CLANG_PREFIX/bin/clang++
./pr-check.sh
# - uses: codecov/codecov-action@v1
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: mpi4py/setup-mpi@v1
# Used to host cibuildwheel
- uses: actions/setup-python@v5
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.19.0
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
conda:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11']
fail-fast: false
steps:
- uses: actions/checkout@v2
- if: ${{ contains(matrix.os, 'macos') }}
uses: conda-incubator/setup-miniconda@v3
- name: Setup micromamba and boa
uses: mamba-org/setup-micromamba@v1
with:
environment-name: test-env
create-args: >-
python=${{ matrix.python-version }}
boa
- name: Build and test package
id: build-package
run: |
export CONDA_HOME=$CONDA
conda install conda-build
out_dir="${{ matrix.os }}-build"
.conda/bin/build ${{ matrix.python-version }} $out_dir
echo "PACKAGE_PATH=${out_dir}" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v3
with:
path: ${{ steps.build-package.outputs.PACKAGE_PATH }}
publish_conda:
needs: [conda, pypi]
name: Publish to Anaconda
environment: anaconda
permissions:
id-token: write
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: ${{ steps.build-package.outputs.PACKAGE_PATH }}
- name: List files in artifact
run: find ${{ steps.build-package.outputs.PACKAGE_PATH }} -type f -name "*.tar.bz2"
- name: Upload to Anaconda
run: |
export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_TOKEN }}
find ${{ steps.build-package.outputs.PACKAGE_PATH }} -type f -name "*.tar.bz2" -exec echo "anaconda upload {}" \;
dist:
name: Distribution build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@v1
publish_pypi:
name: Publish to PyPI
needs: [dist, pypi, conda]
environment:
name: pypi
url: https://pypi.org/p/brainiak
permissions:
id-token: write
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
with:
name: Packages
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1