Skip to content

Merge pull request #4 from anustg/yamlfix #41

Merge pull request #4 from anustg/yamlfix

Merge pull request #4 from anustg/yamlfix #41

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: solsticepy Linux
on:
workflow_dispatch:
#
push:
branches: [ $default-branch, master]
pull_request:
branches: [ $default-branch, master]
#[ $default-branch, master-m ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
include:
- os: ubuntu-20.04
python-version: 3.8
- os: ubuntu-22.04
python-version: 3.11
env:
PYTEST_ADDOPTS: --color=yes
SOLSTICEVER: 0.9.1
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install scons numpy scipy matplotlib colorama uncertainties pytest flake8
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Show Python context
run: |
python3 -m pip list
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 solsticepy --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 solsticepy --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install Solstice
run: |
sudo apt install build-essential libpolyclipping-dev libtbb-dev libyaml-dev libgomp1
export UBVER=`lsb_release -cs`
export SOLSTICEURL="https://github.com/anustg/installation-packages/releases/download/omc-dakota-solstice-installation/solstice-${SOLSTICEVER}-x86_64-$UBVER.tar.gz"
sudo tar zxv --strip-components=3 -C /usr/local < <(wget "$SOLSTICEURL" -q -O-)
echo "CHECK SOLSTICE DEPS"
export PATH=$PATH:/usr/local/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
ldd `which solstice`
echo "CHECKING SOLSTICE RUNS..."
solstice --version
echo "-----"
echo "SOLSTICE VERSION:"
solstice --version
- name: Install solsticepy
run: |
python3 -m pip install .
- name: Install postprocessing programs
run: |
cd postproc
scons INSTALL_PREFIX=~/bin install
cd .
- name: Test solsticepy
run: |
export PATH=$PATH:/usr/local/bin:~/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
cd tests
python -m pytest
# vim: ts=2:sw=2:et