Skip to content

Commit

Permalink
refactor CI, fix pypi deploy (#1189)
Browse files Browse the repository at this point in the history
* refactor CI, fix pypi deploy

* cleanup

* unfold AMICI build

* fix name

* fix yaml

* fix script name

* cleanup

* install cpputest

* fixups

* install numpy

* fix sphinx

* ?

* fixup
  • Loading branch information
FFroehlich authored Aug 6, 2020
1 parent d0aabed commit 12795cb
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 86 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/deploy_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,11 @@ jobs:
- name: apt
run: |
sudo apt-get update \
&& sudo apt-get install -y swig3.0
- name: pip
run: |
pip3 install --upgrade --user wheel \
&& pip3 install --upgrade --user setuptools
&& sudo apt-get install -y swig
- name: Create AMICI sdist
run: |
cd python/sdist && /usr/bin/python3 setup.py sdist
scripts/buildSdist.sh
- name: "Upload artifact: sdist"
uses: actions/upload-artifact@v1
Expand Down
18 changes: 5 additions & 13 deletions .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,16 @@ jobs:
- name: apt
run: |
sudo apt-get update \
&& sudo apt-get install -y swig3.0
- name: pip
&& sudo apt-get install -y swig
- name: sdist
run: |
pip3 install --upgrade --user wheel \
&& pip3 install --upgrade --user setuptools
- name: Create AMICI sdist
run: |
cd python/sdist && python3 setup.py sdist
- name: Check build
run: |
ls ./build/python
scripts/buildSdist.sh
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
packages_dir: ./build/python
packages_dir: python/sdist/dist

2 changes: 1 addition & 1 deletion .github/workflows/test_benchmark_collection_models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: apt
run: |
sudo apt-get update \
&& sudo apt-get install -y swig3.0 libatlas-base-dev
&& sudo apt-get install -y swig libatlas-base-dev
- name: pip
run: |
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,12 @@ jobs:
run: |
sudo apt-get update \
&& sudo apt-get install -y \
cmake \
g++ \
libatlas-base-dev \
libboost-serialization-dev \
libhdf5-serial-dev \
python3-dev \
python3-venv \
swig \
lcov
- name: Install python package
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Installation
on: [push]

jobs:
build:
archive:
name: Archive Install

runs-on: ubuntu-latest
Expand All @@ -12,7 +12,6 @@ jobs:
- run: git fetch --prune --unshallow

- run: echo "::set-env name=AMICI_DIR::$(pwd)"
- run: echo "::set-env name=BNGPATH::${AMICI_DIR}/ThirdParty/BioNetGen-2.3.2"

# install amici dependencies
- name: apt
Expand All @@ -29,7 +28,7 @@ jobs:
- name: Build suitesparse
run: |
scripts/buildSuiteSparse.sh
- name: Build sundials
run: |
scripts/buildSundials.sh
Expand All @@ -38,15 +37,46 @@ jobs:
run: |
scripts/buildCpputest.sh
- name: Build cpputest
- name: pip
run: |
scripts/buildBNGL.sh
pip3 install numpy
- name: Build AMICI
run: |
pip3 install numpy \
&& scripts/buildAmici.sh
scripts/buildAmici.sh
- name: Install python archive
run: |
scripts/installAmiciArchive.sh
sdist:
name: sdist Install

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- run: git fetch --prune --unshallow

- run: echo "::set-env name=AMICI_DIR::$(pwd)"

# install amici dependencies
- name: apt
run: |
sudo apt-get update \
&& sudo apt-get install -y \
g++ \
libatlas-base-dev \
libboost-serialization-dev \
libhdf5-serial-dev \
swig
- name: Create AMICI sdist
run: |
scripts/buildSdist.sh
- name: Install python sdist
run: |
pip3 install -v --user $(ls -t python/sdist/dist/amici-*.tar.gz | head -1)
2 changes: 1 addition & 1 deletion .github/workflows/test_large_model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: apt
run: |
sudo apt-get update \
&& sudo apt-get install -y swig3.0 libatlas-base-dev
&& sudo apt-get install -y swig libatlas-base-dev
- name: pip
run: |
pip3 install --upgrade --user wheel \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_petab_test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: |
sudo apt-get update \
&& sudo apt-get install -y \
swig3.0 \
swig \
libatlas-base-dev \
python3-venv
Expand Down
35 changes: 3 additions & 32 deletions .github/workflows/test_python_cplusplus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,13 @@ jobs:
libatlas-base-dev \
libboost-serialization-dev \
libhdf5-serial-dev \
python3-dev \
python3-venv \
swig \
lcov
- name: Build suitesparse
- name: Build AMICI dependencies
run: |
scripts/buildSuiteSparse.sh
- name: Build sundials
run: |
scripts/buildSundials.sh
- name: Build cpputest
run: |
scripts/buildCpputest.sh
- name: Build BNGL
run: |
scripts/buildBNGL.sh
scripts/buildDependencies.sh
- name: Build AMICI
run: |
Expand Down Expand Up @@ -149,25 +136,9 @@ jobs:
run: |
brew install hdf5 swig gcc cppcheck libomp
- name: Build suitesparse
run: |
scripts/buildSuiteSparse.sh
- name: Build sundials
run: |
scripts/buildSundials.sh
- name: Build cpputest
run: |
scripts/buildCpputest.sh
- name: Build BNG
run: |
scripts/buildBNGL.sh
- name: Build AMICI
run: |
scripts/buildAmici.sh
scripts/buildAll.sh
- name: Install python package
run: |
Expand Down
18 changes: 1 addition & 17 deletions .github/workflows/test_valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ name: C++ Tests
on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
- master

jobs:
Expand All @@ -33,23 +31,9 @@ jobs:
swig \
valgrind
- name: Build suitesparse
run: |
scripts/buildSuiteSparse.sh
- name: Build sundials
run: |
scripts/buildSundials.sh
- name: Build cpputest
run: |
scripts/buildCpputest.sh
- name: Build AMICI
# TODO: should get rid of having to install numpy before
run: |
pip3 install numpy \
&& scripts/buildAmici.sh
scripts/buildAll.sh
- name: C++ tests / Valgrind
run: |
Expand Down
5 changes: 1 addition & 4 deletions scripts/buildAll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@ set -e
script_path=$(dirname "$BASH_SOURCE")
script_path=$(cd "$script_path" && pwd)

"${script_path}/buildSuiteSparse.sh"
"${script_path}/buildSundials.sh"
"${script_path}/buildCpputest.sh"
"${script_path}/buildBNGL.sh"
"${script_path}/buildDependencies.sh"
"${script_path}/buildAmici.sh"
14 changes: 14 additions & 0 deletions scripts/buildDependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
#
# Build AMICI along with dependencies and test suite
#
set -e

script_path=$(dirname "$BASH_SOURCE")
script_path=$(cd "$script_path" && pwd)

"${script_path}/buildSuiteSparse.sh"
"${script_path}/buildSundials.sh"
"${script_path}/buildCpputest.sh"
"${script_path}/buildBNGL.sh"
pip3 install numpy
14 changes: 14 additions & 0 deletions scripts/buildSdist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
#
# Create AMICI sdist for PyPI deployment
#
set -e

script_path=$(dirname "$BASH_SOURCE")
amici_path=$(cd "$script_path/.." && pwd)

pip3 install --upgrade --user wheel
pip3 install --upgrade --user setuptools

cd "${amici_path}/python/sdist"
python3 setup.py sdist

0 comments on commit 12795cb

Please sign in to comment.