diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml new file mode 100644 index 0000000..56727d9 --- /dev/null +++ b/.github/workflows/python-test.yml @@ -0,0 +1,36 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Build & Test + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Checkout submodules + run: git submodule update --init --recursive + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install openmpi + run: | + sudo apt install openmpi-bin libopenmpi-dev + - name: Install package + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install . + - name: Test with pytest + run: | + pytest tests/ diff --git a/README.md b/README.md index 7029507..816b49a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # PlasmaOpt +![build-and-test-status](https://github.com/florianwechsung/PyPlasmaOpt/workflows/Build%20&%20Test/badge.svg) + + ## Requirements On a recent linux (e.g. Ubuntu > 18.04), most requirements should be met. diff --git a/setup.py b/setup.py index c0619b3..1091608 100644 --- a/setup.py +++ b/setup.py @@ -129,7 +129,7 @@ def build_extensions(self): name='PlasmaOpt', long_description='', ext_modules=ext_modules, - install_requires=['pybind11>=2.4', 'sympy', 'property_manager3', 'numpy', 'scipy', 'argparse', 'mpi4py', 'matplotlib', 'randomgen'], + install_requires=['pybind11>=2.4', 'sympy', 'property_manager3', 'numpy', 'scipy', 'argparse', 'mpi4py', 'matplotlib', 'randomgen', 'netCDF4'], setup_requires=['pybind11>=2.4'], cmdclass={'build_ext': BuildExt}, packages = ["pyplasmaopt"],