Update setup to include a few more requirements #2333
Workflow file for this run
This file contains 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: 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: Get pip cache dir | |
id: pip-cache | |
run: | | |
echo "::set-output name=dir::$(pip cache dir)" | |
- name: Obtain pip cache (Linux) | |
uses: actions/cache@v2 | |
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 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<1.24" 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 |