Skip to content

Build and Test on diverse OS #52

Build and Test on diverse OS

Build and Test on diverse OS #52

name: Unit tests on diverse OS
on: workflow_dispatch
permissions:
contents: read
jobs:
build:
strategy:
matrix:
# python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.11"]
# os: [ubuntu-22.04, ubuntu-20.04, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
#
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
#
- name: Checkout repository
uses: actions/checkout@v3
#
- name: Setup conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
python-version: ${{ matrix.python-version }}
conda-channels: anaconda, conda-forge
#
- name: Install dependencies for MacOs
if: startsWith(matrix.os, 'macos')
run: |
conda install -c conda-forge -y plantuml
brew install suite-sparse llvm libomp
echo 'CC="/usr/local/opt/llvm/bin/clang"' >> $GITHUB_ENV
echo 'PATH="/usr/local/opt/llvm/bin:$PATH"' >> $GITHUB_ENV
echo 'LDFLAGS="-L/usr/local/opt/llvm/lib:$LDFLAGS"' >> $GITHUB_ENV
echo 'CFLAGS="-I/usr/local/opt/llvm/include:$CFLAGS"' >> $GITHUB_ENV
#
- name: Install dependencies for Windows
if: startsWith(matrix.os, 'windows')
run: |
conda install -c conda-forge -y suitesparse plantuml
echo 'INCLUDE += ";C:\Miniconda\envs\__setup_conda\Library\include\suitesparse;C:\Miniconda\envs\__setup_conda\Lib\site-packages\sparseqr"' >> $env:GITHUB_ENV
echo 'PATH += ";C:\Miniconda\envs\__setup_conda\Library\include\suitesparse;C:\Miniconda\envs\__setup_conda\Lib\site-packages\sparseqr"' >> $env:GITHUB_ENV
echo 'LIB += ";C:\Miniconda\envs\__setup_conda\Library\include\suitesparse;C:\Miniconda\envs\__setup_conda\Lib\site-packages\sparseqr"' >> $env:GITHUB_ENV
- name: Install dependencies for Ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: |
conda install -c conda-forge -y suitesparse clang plantuml openmp
- name: Build Test Docs
run: |
pip install --upgrade pip
pip install scipy numpy matplotlib sparseqr==1.2 networkx mpmath Cython
python setup.py build_ext --inplace
pip install --upgrade pip
pip install .[cli,docs,test,build]
python -m build
python setup.py build_ext --inplace
pytest
cd docs
make html
cd ..
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './dist/'
gather-dists:
runs-on: ubuntu-latest
needs: build
if: success() || failure()
steps:
- uses: actions/checkout@v3
- name: Download reports' artifacts
uses: actions/download-artifact@v3
with:
path: ./dist
- name: Upload artifact
run: |
ls
cd ./dist
ls
# pip install --upgrade pip
# pip install build
# python -m build
#
# pip install .[cli,docs,test,build]
#
# pip install scipy numpy matplotlib sparseqr==1.2 networkx mpmath Cython
# python setup.py build_ext --inplace
#
# pytest
#
# cd docs
# make html
#
# pytest
#
# cd docs
# make html