Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: PyBaMM

on: [push]

jobs:

style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check style
uses: actions/setup-python@v1
with:
python-version: 3.7

- name: Install package
run: |
python -m pip install --upgrade pip
pip install -e .[dev]

- name: Check style
run: python -m flake8

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

env:
LD_LIBRARY_PATH: 'SuiteSparse-5.6.0/lib:sundials/lib'

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

- name: Install Linux system dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt install gfortran gcc libopenblas-dev liblapack-dev graphviz libsuitesparse-dev
sudo apt install python${{ matrix.python-version }}.dev

- name: Install MacOS system dependencies
if: matrix.os == 'macos-latest'
run: |
brew update
brew install graphviz openssl readline
brew install gcc cmake openblas suitesparse

- name: Install Windows system dependencies
if: matrix.os == 'windows-latest'
run: choco install graphviz

- name: Install standard python dependencies
run: |
python -m pip install --upgrade pip
pip install .

- name: Install SUNDIALS and SuiteSparse
if: matrix.os != 'windows-latest'
run: |
pip install wget
python setup.py install_odes -f
mkdir -p third-party/pybind11
git clone https://github.com/pybind/pybind11.git third-party/pybind11
python setup.py install_klu -f

- name: Run unit tests
run: |
echo Sundials library path: $LD_LIBRARY_PATH
python run-tests.py --unit --folder all

- name: Install docs dependencies and run doctests
if: matrix.os != 'windows-latest'
run: |
pip install -e .[docs]
python run-tests.py --doctest

- name: Install dev python dependencies and run style and example tests
if: matrix.os != 'windows-latest'
run: |
pip install -e .[dev]
python run-tests.py --examples

- name: Instal and run coverage
if: success() && (matrix.os == 'unbuntu-latest' && matrix.python-version == 3.7)
run: |
pip install coverage codecov
codecov