Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Actions for CI #855

Merged
merged 27 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6fc5944
Add GitHub CI.
dalonsoa Feb 24, 2020
40ddcf2
Merge pull request #1 from dalonsoa/github_ci
dalonsoa Feb 24, 2020
9d6486f
Add DYLD_LIBRARY_PATH as ENV.
dalonsoa Mar 26, 2020
b5a2db6
Merge branch 'github_ci'
dalonsoa Mar 26, 2020
9b4ecdd
Correct library path.
dalonsoa Mar 26, 2020
719faf5
Correct library path.
dalonsoa Mar 26, 2020
b5702ac
Change definition of ENV to the relevant steps.
dalonsoa Mar 27, 2020
360cb80
Removed already installed dependencies in MacOS.
dalonsoa Mar 27, 2020
f5d5e4b
Add scheduled testing.
dalonsoa Mar 27, 2020
786aad5
:bug: libsparse tests not working in macOS.
dalonsoa May 11, 2020
1494608
:bug: removed too much.
dalonsoa May 11, 2020
113486c
Change to new KLU installer.
dalonsoa May 11, 2020
4d1d5cb
Merge branch 'develop' into add_github_actions
dalonsoa May 11, 2020
cb1aed3
Add wheel dependency.
dalonsoa May 11, 2020
549c47b
Add missing dependencies.
dalonsoa May 11, 2020
078c8ed
Still playing with the libraries.
dalonsoa May 11, 2020
0743552
Still playing with the libraries.
dalonsoa May 11, 2020
a577cd2
Still playing with the libraries.
dalonsoa May 11, 2020
92ff49e
Still playing with the libraries.
dalonsoa May 11, 2020
2182270
Still playing with the libraries.
dalonsoa May 11, 2020
5cf2452
Still playing with the libraries.
dalonsoa May 11, 2020
e47def4
:bug: Doctets failing due to mismatch in unsorted output.
dalonsoa May 11, 2020
bdb11b9
Update CHANGELOG.
dalonsoa May 11, 2020
8d41cc9
Merge branch 'sorted_cli_params' into add_github_actions
dalonsoa May 11, 2020
a9b55b6
Add scikit solvers. Update CHANGELOG.
dalonsoa May 11, 2020
ff74529
Review scikit.odes installation.
dalonsoa May 14, 2020
5dcf52b
Remove space.
dalonsoa May 14, 2020
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
106 changes: 106 additions & 0 deletions .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: PyBaMM

on:
push:

# everyday at 3 am UTC
schedule:
- cron: '* 3 * * *'

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 wheel setuptools
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]

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
sudo apt install python${{ matrix.python-version }}.dev

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

- 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 wheel setuptools
pip install -e .

- name: Install SUNDIALS and SuiteSparse
if: matrix.os != 'windows-latest'
run: |
pip install wget
git clone https://github.com/pybind/pybind11.git
python scripts/setup_KLU_module_build.py
export SUNDIALS_INST=$HOME/.local
pip install scikits.odes
pip install -e .

- name: Run unit tests Windows
if: matrix.os == 'windows-latest'
run: |
python run-tests.py --unit --folder all

- name: Run unit tests
if: matrix.os != 'windows-latest'
run: |
export LD_LIBRARY_PATH=$HOME/.local/lib:scikits.odes/sundials5/lib:$LD_LIBRARY_PATH
python run-tests.py --unit --folder all
tlestang marked this conversation as resolved.
Show resolved Hide resolved

- name: Install docs dependencies and run doctests
if: matrix.os != 'windows-latest'
run: |
export LD_LIBRARY_PATH=$HOME/.local/lib:scikits.odes/sundials5/lib:$LD_LIBRARY_PATH
pip install -e .[docs]
python run-tests.py --doctest

- name: Install dev dependencies and run example tests
if: matrix.os != 'windows-latest'
run: |
export LD_LIBRARY_PATH=$HOME/.local/lib:scikits.odes/sundials5/lib:$LD_LIBRARY_PATH
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

## Optimizations

- Implementing the use of GitHub Actions for CI ([#855](https://github.com/pybamm-team/PyBaMM/pull/855))
- Changed default solver for DAE models to `CasadiSolver` ([#978](https://github.com/pybamm-team/PyBaMM/pull/978))
- Added some extra simplifications to the expression tree ([#971](https://github.com/pybamm-team/PyBaMM/pull/971))
- Changed the behaviour of "safe" mode in `CasadiSolver` ([#956](https://github.com/pybamm-team/PyBaMM/pull/956))
Expand All @@ -20,6 +21,7 @@

## Bug fixes

- Fix doctests failing due to mismatch in unsorted output.([#990](https://github.com/pybamm-team/PyBaMM/pull/990))
- Added extra checks when creating a model, for clearer errors ([#971](https://github.com/pybamm-team/PyBaMM/pull/971))
- Fixed `Interpolant` ids to allow processing ([#962](https://github.com/pybamm-team/PyBaMM/pull/962))
- Fixed a bug in the initial conditions of the potential pair model ([#954](https://github.com/pybamm-team/PyBaMM/pull/954))
Expand Down
10 changes: 5 additions & 5 deletions pybamm/parameters_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ def list_parameters(arguments=None):
>>> from pybamm.parameters_cli import list_parameters
>>> list_parameters(["lithium-ion", "anodes"])
Available package parameters:
* graphite_Ecker2015
* graphite_Chen2020
* graphite_mcmb2528_Marquis2019
* graphite_UMBL_Mohtat2020
* graphite_Ecker2015
* graphite_Kim2011
* graphite_UMBL_Mohtat2020
* graphite_mcmb2528_Marquis2019
Available local parameters:
"""
parser = argparse.ArgumentParser(
Expand All @@ -179,7 +179,7 @@ def list_parameters(arguments=None):
root, package_dirs, files = next(os.walk(package_dir))

print("Available package parameters:")
for dirname in package_dirs:
for dirname in sorted(package_dirs):
print(" * {}".format(dirname))

local_dir = os.path.join("input", "parameters", args.battery_type, args.component)
Expand All @@ -188,5 +188,5 @@ def list_parameters(arguments=None):
else:
local_dirs = []
print("Available local parameters:")
for dirname in local_dirs:
for dirname in sorted(local_dirs):
print(" * {}".format(dirname))