Skip to content

Commit

Permalink
Merge branch 'main' into ESS_GUI_uncertainties
Browse files Browse the repository at this point in the history
  • Loading branch information
Caddy-Jones authored Aug 17, 2021
2 parents e2c8441 + a18f684 commit 23498a5
Show file tree
Hide file tree
Showing 133 changed files with 9,727 additions and 3,830 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Docs

on:
[push, pull_request]

defaults:
run:
shell: bash

jobs:
doc-build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9]

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: Obtain pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ matrix.OS }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/test.yml') }}
restore-keys: |
${{ matrix.OS }}-pip-${{ matrix.python-version }}-
${{ matrix.OS }}-pip-
### Installation of build-dependencies

- name: Install packaged dependencies
run: |
sudo apt-get update
sudo apt-get install opencl-headers ocl-icd-opencl-dev libpocl2 xvfb pyqt5-dev-tools
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel setuptools
python -m pip install numpy scipy matplotlib docutils "pytest<6" sphinx unittest-xml-reporting tinycc lxml h5py sphinx pyparsing html5lib reportlab pybind11 appdirs six numba mako ipython qtconsole xhtml2pdf unittest-xml-reporting pylint qt5reactor periodictable PyQt5
- name: Install pyopencl
run: |
python -m pip install pyopencl
- name: Fetch sources for sibling projects
run: |
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 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/
xvfb-run -a --server-args="-screen 0 1024x768x24" python build_sphinx.py || true
134 changes: 134 additions & 0 deletions .github/workflows/installers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: Installer

on:
[push, pull_request]

defaults:
run:
shell: bash

jobs:
windows-installer:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
python-version: [3.9]

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: Obtain pip cache (Windows)
uses: actions/cache@v2
if: startsWith(runner.os, 'Windows')
with:
path: ~\AppData\Local\pip\Cache
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 Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel setuptools
python -m pip install numpy scipy matplotlib docutils "pytest<6" sphinx unittest-xml-reporting tinycc lxml h5py sphinx pyparsing html5lib reportlab pybind11 appdirs six numba mako ipython qtconsole xhtml2pdf unittest-xml-reporting pylint qt5reactor periodictable PyQt5
- name: Install pyopencl (Windows)
run: |
python -m pip install pytools mako cffi
choco install opencl-intel-cpu-runtime
python -m pip install --only-binary=pyopencl --find-links http://www.silx.org/pub/wheelhouse/ --trusted-host www.silx.org 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/sasmodels.git ../sasmodels
git clone --depth=50 --branch=master https://github.com/bumps/bumps.git ../bumps
- 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 pyinstaller
run: |
cd installers
pyinstaller.exe sasview.spec
- name: Make tarball of sasview pyinstaller output directory
run: |
cd installers/dist
tar zcf sasview-pyinstaller-dist.tar.gz sasview
- name: Publish pyinstaller components
uses: actions/upload-artifact@v2
with:
name: SasView-PyInstaller-Dist-${{ matrix.os }}-${{ matrix.python-version }}-${{ github.sha }}
path: installers/dist/sasview-pyinstaller-dist.tar.gz
if-no-files-found: error

- name: Build sasview INNO setup package
run: |
iscc installers/installer.iss
- name: Publish installer package
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
135 changes: 135 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: Tests

on:
[push, pull_request]

defaults:
run:
shell: bash

jobs:
unit-test:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
fail-fast: false

steps:

- name: Obtain SasView source from git
uses: actions/checkout@v1

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

### Caching of pip downloads and local wheel builds

- name: Obtain pip cache (Linux)
uses: actions/cache@v2
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/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 (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: ~\AppData\Local\pip\Cache
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 packaged dependencies (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get install opencl-headers ocl-icd-opencl-dev libpocl2 xvfb pyqt5-dev-tools
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel setuptools
python -m pip install numpy scipy matplotlib docutils "pytest<6" sphinx unittest-xml-reporting tinycc lxml h5py sphinx pyparsing html5lib reportlab pybind11 appdirs six numba mako ipython qtconsole xhtml2pdf unittest-xml-reporting pylint qt5reactor periodictable PyQt5
- name: Install pyopencl (Linux + macOS)
if: ${{ matrix.os != 'windows-latest' }}
run: |
python -m pip install pyopencl
- name: Install pyopencl (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
python -m pip install pytools mako cffi
choco install opencl-intel-cpu-runtime
python -m pip install --only-binary=pyopencl --find-links http://www.silx.org/pub/wheelhouse/ --trusted-host www.silx.org pyopencl
- name: Fetch sources for sibling projects
run: |
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 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: Test with pytest
env:
PYOPENCL_COMPILER_OUTPUT: 1
run: |
python -m pytest -v -s test
- name: Test GUI (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
env:
PYOPENCL_COMPILER_OUTPUT: 1
run: |
cd src/sas/qtgui
xvfb-run -a --server-args="-screen 0 1024x768x24" python GUITests.py || true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ default_categories.json
/test/sasdataloader/data/isis_1_0_write_test.xml
/test/sasdataloader/data/isis_1_1_write_test.xml
/test/sasdataloader/data/write_test.xml
/test/sascalculator/data/write_test.sld
/test/fileconverter/data/export2d.h5
**/logs
tests.log
Expand Down
Loading

0 comments on commit 23498a5

Please sign in to comment.