Skip to content

Building resolution kernels #1792

Building resolution kernels

Building resolution kernels #1792

Workflow file for this run

name: Installer
#Build all branches except release
on:
push:
branches-ignore:
- release*
pull_request:
branches-ignore:
- release*
defaults:
run:
shell: bash
jobs:
installer:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: [3.8]
steps:
- name: Obtain SasView source from git
uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
### Caching of pip downloads and local wheel builds
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Obtain pip cache (macOS)
uses: actions/cache@v2
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/test.yml') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: Obtain pip cache (Windows)
uses: actions/cache@v2
if: startsWith(runner.os, 'Windows')
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/test.yml') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
### Installation of build-dependencies
- name: Install lxml and MPL (Linux + Win)
if: ${{ matrix.os != 'macos-latest' }}
run: |
python -m pip install matplotlib==2.2.5
python -m pip install lxml
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel setuptools
python -m pip install numpy scipy==1.7.3 docutils "pytest<6" sphinx unittest-xml-reporting
python -m pip install tinycc h5py sphinx pyparsing html5lib reportlab==3.6.6 pybind11 appdirs
python -m pip install six numba mako ipython qtconsole xhtml2pdf unittest-xml-reporting pylint
python -m pip install qt5reactor periodictable uncertainties debugpy dominate importlib_resources
python -m pip install html2text
- name: Install PyQt (Windows + Linux)
if: ${{ matrix.os != 'macos-latest' }}
run: |
python -m pip install PyQt5
- name: Install lxml, matplotlib and PyQt (OSX)
if: ${{ matrix.os == 'macos-latest' }}
run: |
python -m pip install PyQt5==5.13
python -m pip install matplotlib==3.4.3
python -m pip install --no-binary lxml lxml
- name: Install pyopencl (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
python -m pip install pytools mako cffi
choco install opencl-intel-cpu-runtime
choco install innosetup
python -m pip install --only-binary=pyopencl --find-links http://www.silx.org/pub/wheelhouse/ --trusted-host www.silx.org pyopencl
- name: Install pyopencl (Linux + macOS)
if: ${{ matrix.os != 'windows-latest' }}
run: |
python -m pip install pyopencl
- name: Install utilities to build installer
run: |
python -m pip install pyinstaller
- name: Fetch sources for sibling projects
run: |
git clone --depth=50 --branch=master https://github.com/SasView/sasdata.git ../sasdata
git clone --depth=50 --branch=master https://github.com/SasView/sasmodels.git ../sasmodels
git clone --depth=50 --branch=master https://github.com/bumps/bumps.git ../bumps
- name: Build and install sasdata
run: |
cd ../sasdata
rm -rf build
rm -rf dist
python setup.py clean
python setup.py build
python -m pip install .
- name: Build and install sasmodels
run: |
cd ../sasmodels
rm -rf build
rm -rf dist
python setup.py clean
python setup.py build
python -m pip install .
- name: Build and install bumps
run: |
cd ../bumps
rm -rf build
rm -rf dist
python setup.py clean
python setup.py build
python -m pip install .
### Actual building/testing of sasview
- name: Build sasview
run: |
# SET SASVIEW GITHASH
githash=$( git rev-parse HEAD )
sed -i.bak s/GIT_COMMIT/$githash/g src/sas/sasview/__init__.py
# BUILD SASVIEW
python setup.py clean
python setup.py build
python -m pip install .
- name: Build sasmodels and bumps docs
run: |
make -C ../bumps/doc html || true
mkdir -p ~/.sasmodels/compiled_models
make -j4 -C ../sasmodels/doc html || true
- name: Build sasview docs
run: |
cd docs/sphinx-docs/
python build_sphinx.py || true
### Build the installer
- name: Build sasview with pyinstaller
run: |
cd installers
pyinstaller sasview.spec
- name: Build sasview with INNO setup package (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
iscc installers/installer.iss
- name: Publish installer package (Windows)
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/upload-artifact@v2
with:
name: SasView-Installer-${{ matrix.os }}-${{ matrix.python-version }}-${{ github.sha }}
path: installers/Output/setupSasView.exe
if-no-files-found: error
- name: Create dmg file (OSX)
if: ${{ matrix.os == 'macos-latest' }}
run: |
cd installers/dist
hdiutil create SasView5.dmg -srcfolder SasView5.app -ov -format UDZO
- name: Publish installer package (OSX)
if: ${{ matrix.os == 'macos-latest' }}
uses: actions/upload-artifact@v2
with:
name: SasView-Installer-${{ matrix.os }}-${{ matrix.python-version }}-${{ github.sha }}
path: installers/dist/SasView5.dmg
if-no-files-found: error
- name: Declare env variables on push only
if: github.event_name == 'push'
shell: bash
run: echo "BRANCH_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Declare env variables on pull_request only
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$GITHUB_HEAD_REF" >> $GITHUB_ENV
- name: Upload installer to GitHub releases
#Release and main branch will be treated differently
if: env.BRANCH_NAME != 'main'
uses: ncipollo/release-action@v1
with:
draft: true
prerelease: true
allowUpdates: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "installers/dist/SasView5.dmg, installers/Output/setupSasView.exe"
name: ${{ env.BRANCH_NAME }}
tag: ${{ env.BRANCH_NAME }}