-
-
Notifications
You must be signed in to change notification settings - Fork 563
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
Changes from 9 commits
6fc5944
40ddcf2
9d6486f
b5a2db6
9b4ecdd
719faf5
b5702ac
360cb80
f5d5e4b
786aad5
1494608
113486c
4d1d5cb
cb1aed3
549c47b
078c8ed
0743552
a577cd2
92ff49e
2182270
5cf2452
e47def4
bdb11b9
8d41cc9
a9b55b6
ff74529
5dcf52b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
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 | ||
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' | ||
DYLD_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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
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 suitesparse | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suitesparse isnt required since compiled and installed later on |
||
|
||
- 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 | ||
mkdir -p third-party/pybind11 | ||
git clone https://github.com/pybind/pybind11.git third-party/pybind11 | ||
python setup.py install_all -f | ||
source ~/.bashrc | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I understand correctly, each command in GitHub steps is ran using |
||
|
||
- name: Run unit tests | ||
run: | | ||
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: | | ||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think thats required as
LD_LIBRARY_PATH
has precedence overDYLD_LIBRARY_PATH
.See the apple docs