Repository: myokit/myokit (language: python)

Issue:
Add workflow to test against different sundials versions
Should be possible to get them from github

e.g. https://github.com/LLNL/sundials/tree/v2.7.0


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/install-sundials-manually.sh b/.github/workflows/install-sundials-manually.sh
new file mode 100755
index 000000000..97a5aef82
--- /dev/null
+++ b/.github/workflows/install-sundials-manually.sh
@@ -0,0 +1,15 @@
+cd sundials
+mkdir build
+cd build
+cmake \
+  -DBUILD_SHARED_LIBS=ON \
+  -DBUILD_STATIC_LIBS=OFF \
+  -DBUILD_ARKODE=OFF \
+  -DBUILD_IDA=OFF \
+  -DBUILD_IDAS=OFF \
+  -DBUILD_KINSOL=OFF \
+  -DEXAMPLES_ENABLE=OFF \
+  -DEXAMPLES_ENABLE_C=OFF \
+  ../
+make
+sudo make install


Test patch:
diff --git a/.github/workflows/coverage-test.yml b/.github/workflows/coverage-test.yml
index 7f5217ab8..bd0a2347c 100644
--- a/.github/workflows/coverage-test.yml
+++ b/.github/workflows/coverage-test.yml
@@ -16,7 +16,7 @@ jobs:
     if: github.event.pull_request.draft == false
 
     steps:
-      - uses: actions/checkout@v1
+      - uses: actions/checkout@v2
 
       - name: Configure Python
         uses: actions/setup-python@v1
diff --git a/.github/workflows/docs-test.yml b/.github/workflows/docs-test.yml
index a18447758..143daec1b 100644
--- a/.github/workflows/docs-test.yml
+++ b/.github/workflows/docs-test.yml
@@ -16,7 +16,7 @@ jobs:
     if: github.event.pull_request.draft == false
 
     steps:
-      - uses: actions/checkout@v1
+      - uses: actions/checkout@v2
 
       - name: Configure Python
         uses: actions/setup-python@v1
diff --git a/.github/workflows/style-test.yml b/.github/workflows/style-test.yml
index d44cc79ce..36edaf7b6 100644
--- a/.github/workflows/style-test.yml
+++ b/.github/workflows/style-test.yml
@@ -16,7 +16,7 @@ jobs:
     if: github.event.pull_request.draft == false
 
     steps:
-      - uses: actions/checkout@v1
+      - uses: actions/checkout@v2
 
       - name: Configure Python
         uses: actions/setup-python@v1
diff --git a/.github/workflows/unit-tests-macos.yml b/.github/workflows/unit-tests-macos.yml
index e1d7c8196..ebea5af62 100644
--- a/.github/workflows/unit-tests-macos.yml
+++ b/.github/workflows/unit-tests-macos.yml
@@ -20,7 +20,7 @@ jobs:
         python-version: [3.7, '3.10']
 
     steps:
-      - uses: actions/checkout@v1
+      - uses: actions/checkout@v2
 
       - name: Configure Python ${{ matrix.python-version }}
         uses: actions/setup-python@v1
diff --git a/.github/workflows/unit-tests-sundials.yml b/.github/workflows/unit-tests-sundials.yml
new file mode 100644
index 000000000..7990cc740
--- /dev/null
+++ b/.github/workflows/unit-tests-sundials.yml
@@ -0,0 +1,52 @@
+name: Sundials unit tests
+on:
+  push:
+    branches:
+      - main
+  pull_request:
+    types: [opened, synchronize, reopened, ready_for_review]
+    branches:
+      - '**'
+
+jobs:
+
+  build-and-test:
+    name: unit-sundials
+    runs-on: ubuntu-latest
+    if: github.event.pull_request.draft == false
+    strategy:
+      matrix:
+        # Latest of each major sundials branche (may overlap with ubuntu tests).
+        sundials-version: ['v2.7.0', 'v3.2.1', 'v4.1.0', 'v5.8.0']
+
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Configure Python
+        uses: actions/setup-python@v1
+        with:
+          #python-version: ${{ matrix.python-version }}
+          architecture: x64
+
+      - name: Check out Sundials ${{ matrix.sundials-version }}
+        uses: actions/checkout@v2
+        with:
+          repository: LLNL/sundials
+          path: sundials
+          ref: ${{ matrix.sundials-version }}
+
+      - name: Install Sundials ${{ matrix.sundials-version }}
+        run: |
+          .github/workflows/install-sundials-manually.sh
+
+      - name: Install Myokit
+        run: |
+          python --version
+          python -m pip install --upgrade pip setuptools wheel
+          python -m pip install .[optional]
+
+      - name: Run unit tests
+        run: |
+          python -m myokit system
+          python -m myokit test unit
+
diff --git a/.github/workflows/unit-tests-ubuntu.yml b/.github/workflows/unit-tests-ubuntu.yml
index 70c75bc27..032fae888 100644
--- a/.github/workflows/unit-tests-ubuntu.yml
+++ b/.github/workflows/unit-tests-ubuntu.yml
@@ -20,7 +20,7 @@ jobs:
         python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
 
     steps:
-      - uses: actions/checkout@v1
+      - uses: actions/checkout@v2
 
       - name: Configure Python ${{ matrix.python-version }}
         uses: actions/setup-python@v1
diff --git a/.github/workflows/unit-tests-windows-miniconda.yml b/.github/workflows/unit-tests-windows-miniconda.yml
index 7bb35e3ac..1bc9ffef4 100644
--- a/.github/workflows/unit-tests-windows-miniconda.yml
+++ b/.github/workflows/unit-tests-windows-miniconda.yml
@@ -16,7 +16,7 @@ jobs:
     if: github.event.pull_request.draft == false
 
     steps:
-      - uses: actions/checkout@v1
+      - uses: actions/checkout@v2
 
       - name: Activate conda
         run: |
diff --git a/.github/workflows/unit-tests-windows.yml b/.github/workflows/unit-tests-windows.yml
index 769684982..94a935a09 100644
--- a/.github/workflows/unit-tests-windows.yml
+++ b/.github/workflows/unit-tests-windows.yml
@@ -20,7 +20,7 @@ jobs:
         python-version: [3.5, '3.10']
 
     steps:
-      - uses: actions/checkout@v1
+      - uses: actions/checkout@v2
 
       - name: Configure Python ${{ matrix.python-version }}
         uses: actions/setup-python@v1