-
-
Notifications
You must be signed in to change notification settings - Fork 577
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from dalonsoa/github_ci
Add GitHub CI
- Loading branch information
Showing
1 changed file
with
95 additions
and
0 deletions.
There are no files selected for viewing
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
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 |