From 44612460ce9840db91be415d6a834f72226b0018 Mon Sep 17 00:00:00 2001
From: Sebastian Schmitt <sebastian.schmitt@kip.uni-heidelberg.de>
Date: Tue, 5 Oct 2021 09:39:04 +0200
Subject: [PATCH] Test `build-catalogue` in CI

- `make install` in CI
- make `build-catalogue` play nice with Python 3.6
- execute `build-catalogue`
---
 .github/workflows/basic.yml | 7 +++++++
 scripts/build-catalogue.in  | 8 ++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/basic.yml b/.github/workflows/basic.yml
index f2400fab..5e22c96e 100644
--- a/.github/workflows/basic.yml
+++ b/.github/workflows/basic.yml
@@ -152,6 +152,11 @@ jobs:
           cmake .. -DCMAKE_CXX_COMPILER=$CXX -DCMAKE_C_COMPILER=$CC -DARB_WITH_PYTHON=ON -DARB_VECTORIZE=${{ matrix.config.simd }} -DPython3_EXECUTABLE=`which python` -DARB_WITH_MPI=${{ matrix.config.mpi }} -DARB_USE_BUNDLED_LIBS=ON
           make -j4 tests examples pyarb html
           cd -
+      - name: Install arbor
+        run: |
+          cd build
+          sudo make install
+          cd -
       - name: Run unit tests
         run: |
           build/bin/unit
@@ -175,3 +180,5 @@ jobs:
         run:  mpirun -n 4 -oversubscribe python python/test/unit_distributed/runner.py -v2
       - name: Run Python examples
         run: scripts/run_python_examples.sh
+      - name: Build a catalogue
+        run: build-catalogue -v default mechanisms/default
diff --git a/scripts/build-catalogue.in b/scripts/build-catalogue.in
index 70c7fdfb..d352a2ed 100755
--- a/scripts/build-catalogue.in
+++ b/scripts/build-catalogue.in
@@ -108,8 +108,12 @@ with TemporaryDirectory() as tmp:
         fd.write(cmake)
     shutil.copy2(f'@ARB_INSTALL_DATADIR@/BuildModules.cmake', tmp)
     shutil.copy2(f'@ARB_INSTALL_DATADIR@/generate_catalogue', tmp)
-    sp.run('cmake ..', shell=True, check=True, capture_output=not verbose)
-    sp.run('make',     shell=True, check=True, capture_output=not verbose)
+    if verbose:
+        out, err = (None, None)
+    else:
+        out, err = (sp.DEVNULL, sp.DEVNULL)
+    sp.run('cmake ..', shell=True, check=True, stdout=out, stderr=err)
+    sp.run('make', shell=True, check=True, stdout=out, stderr=err)
     shutil.copy2(f'{name}-catalogue.so', pwd)
     if not quiet:
         print(f'Catalogue has been built and copied to {pwd}/{name}-catalogue.so')
-- 
GitLab