From fef657e13d7d9dbe1f3ac941c03c59b20869721c Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Wed, 15 Nov 2023 16:40:57 +0100 Subject: [PATCH] GHA: Test composite actions --- .../actions/install-apt-dependencies/action.yml | 15 +++++++++++++++ .../test_benchmark_collection_models.yml | 7 ++----- .github/workflows/test_install.yml | 10 ++++------ .github/workflows/test_performance.yml | 8 +++----- .github/workflows/test_petab_test_suite.yml | 8 ++++---- .github/workflows/test_python_cplusplus.yml | 8 +++----- .github/workflows/test_python_ver_matrix.yml | 11 ++--------- .../workflows/test_sbml_semantic_test_suite.yml | 8 ++++---- .github/workflows/test_valgrind.yml | 10 ++++------ 9 files changed, 41 insertions(+), 44 deletions(-) create mode 100644 .github/actions/install-apt-dependencies/action.yml diff --git a/.github/actions/install-apt-dependencies/action.yml b/.github/actions/install-apt-dependencies/action.yml new file mode 100644 index 0000000000..b9ef5c0dd5 --- /dev/null +++ b/.github/actions/install-apt-dependencies/action.yml @@ -0,0 +1,15 @@ +name: Install apt dependencies +description: Install apt dependencies for the AMICI Python package +runs: + using: "composite" + steps: + - run: | + sudo apt-get update \ + && sudo apt-get install -y \ + libatlas-base-dev \ + libboost-chrono-dev \ + libboost-math-dev \ + libboost-serialization-dev \ + libhdf5-serial-dev \ + swig + shell: bash diff --git a/.github/workflows/test_benchmark_collection_models.yml b/.github/workflows/test_benchmark_collection_models.yml index 9cfa50ea2a..e5d13946e7 100644 --- a/.github/workflows/test_benchmark_collection_models.yml +++ b/.github/workflows/test_benchmark_collection_models.yml @@ -37,11 +37,8 @@ jobs: with: fetch-depth: 20 - # install dependencies - - name: apt - run: | - sudo apt-get update \ - && sudo apt-get install -y swig libatlas-base-dev + - name: Install apt dependencies + uses: ./.github/actions/install-apt-dependencies - run: echo "${HOME}/.local/bin/" >> $GITHUB_PATH diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 6721008599..1ff9208485 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -22,17 +22,15 @@ jobs: - run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV - # install amici dependencies + - name: Install apt dependencies + uses: ./.github/actions/install-apt-dependencies + - name: apt run: | sudo apt-get update \ && sudo apt-get install -y \ cmake \ - g++ \ - libatlas-base-dev \ - libboost-serialization-dev \ - libhdf5-serial-dev \ - swig + g++ - name: Build suitesparse run: | diff --git a/.github/workflows/test_performance.yml b/.github/workflows/test_performance.yml index 871421ffd0..de9dd686d9 100644 --- a/.github/workflows/test_performance.yml +++ b/.github/workflows/test_performance.yml @@ -35,11 +35,9 @@ jobs: with: fetch-depth: 20 - # install dependencies - - name: apt - run: | - sudo apt-get update \ - && sudo apt-get install -y swig libatlas-base-dev + - name: Install apt dependencies + uses: ./.github/actions/install-apt-dependencies + - run: pip3 install petab shyaml build - run: echo "${HOME}/.local/bin/" >> $GITHUB_PATH diff --git a/.github/workflows/test_petab_test_suite.yml b/.github/workflows/test_petab_test_suite.yml index 70acd254df..26a4ac7a26 100644 --- a/.github/workflows/test_petab_test_suite.yml +++ b/.github/workflows/test_petab_test_suite.yml @@ -34,14 +34,14 @@ jobs: with: fetch-depth: 20 + - name: Install apt dependencies + uses: ./.github/actions/install-apt-dependencies + # install dependencies - name: apt run: | sudo apt-get update \ - && sudo apt-get install -y \ - swig \ - libatlas-base-dev \ - python3-venv + && sudo apt-get install -y python3-venv - name: Build BNGL run: | diff --git a/.github/workflows/test_python_cplusplus.yml b/.github/workflows/test_python_cplusplus.yml index 44eeec8acb..a1b68cfc1f 100644 --- a/.github/workflows/test_python_cplusplus.yml +++ b/.github/workflows/test_python_cplusplus.yml @@ -53,6 +53,9 @@ jobs: https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip \ && unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/ \ + - name: Install apt dependencies + uses: ./.github/actions/install-apt-dependencies + # install amici dependencies - name: apt run: | @@ -60,12 +63,7 @@ jobs: && sudo apt-get install -y \ cmake \ g++ \ - libatlas-base-dev \ - libboost-serialization-dev \ - libboost-chrono-dev \ - libhdf5-serial-dev \ python3-venv \ - swig \ lcov \ libboost-math-dev diff --git a/.github/workflows/test_python_ver_matrix.yml b/.github/workflows/test_python_ver_matrix.yml index 59dcf91041..73aba014cd 100644 --- a/.github/workflows/test_python_ver_matrix.yml +++ b/.github/workflows/test_python_ver_matrix.yml @@ -41,15 +41,8 @@ jobs: with: fetch-depth: 20 - # install dependencies - - name: apt - run: | - sudo apt-get update \ - && sudo apt-get install -y \ - swig \ - libatlas-base-dev \ - libhdf5-serial-dev \ - libboost-math-dev + - name: Install apt dependencies + uses: ./.github/actions/install-apt-dependencies # install AMICI - name: Build BNGL diff --git a/.github/workflows/test_sbml_semantic_test_suite.yml b/.github/workflows/test_sbml_semantic_test_suite.yml index 68bfaed8e3..0fde56b8f9 100644 --- a/.github/workflows/test_sbml_semantic_test_suite.yml +++ b/.github/workflows/test_sbml_semantic_test_suite.yml @@ -40,10 +40,10 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 1 - - name: apt - run: | - sudo apt-get update \ - && sudo apt-get install -y swig4.0 libatlas-base-dev + + - name: Install apt dependencies + uses: ./.github/actions/install-apt-dependencies + - run: AMICI_PARALLEL_COMPILE=2 ./scripts/installAmiciSource.sh - run: AMICI_PARALLEL_COMPILE=2 ./scripts/run-SBMLTestsuite.sh ${{ matrix.cases }} diff --git a/.github/workflows/test_valgrind.yml b/.github/workflows/test_valgrind.yml index 1138e663c0..2d4fe44229 100644 --- a/.github/workflows/test_valgrind.yml +++ b/.github/workflows/test_valgrind.yml @@ -34,6 +34,9 @@ jobs: - uses: actions/checkout@v3 - run: git fetch --prune --unshallow + - name: Install apt dependencies + uses: ./.github/actions/install-apt-dependencies + # install amici dependencies - name: apt run: | @@ -41,13 +44,8 @@ jobs: && sudo apt-get install -y \ cmake \ g++ \ - libatlas-base-dev \ - libboost-serialization-dev \ - libhdf5-serial-dev \ python3-venv \ - swig \ - valgrind \ - libboost-math-dev + valgrind - name: Build AMICI run: |