Skip to content

Commit 17f85fb

Browse files
authored
GHA: Modularize actions (apt dependencies, sonar tools) (#2197)
* GHA: Test composite actions * .. * sonar
1 parent 48b8629 commit 17f85fb

File tree

10 files changed

+76
-80
lines changed

10 files changed

+76
-80
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Install apt dependencies
2+
description: Install apt dependencies for the AMICI Python package
3+
runs:
4+
using: "composite"
5+
steps:
6+
- run: |
7+
sudo apt-get update \
8+
&& sudo apt-get install -y \
9+
g++ \
10+
libatlas-base-dev \
11+
libboost-chrono-dev \
12+
libboost-math-dev \
13+
libboost-serialization-dev \
14+
libhdf5-serial-dev \
15+
swig
16+
shell: bash
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Set up Sonar tools
2+
description: Download and install sonar-scanner and build-wrapper
3+
runs:
4+
using: "composite"
5+
steps:
6+
- run: echo "SONAR_SCANNER_VERSION=5.0.1.3006" >> $GITHUB_ENV
7+
shell: bash
8+
- run: echo "SONAR_SCANNER_HOME=${HOME}/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux" >> $GITHUB_ENV
9+
shell: bash
10+
- run: echo "SONAR_SCANNER_OPTS=-server" >> $GITHUB_ENV
11+
shell: bash
12+
- run: echo "${SONAR_SCANNER_HOME}/bin" >> $GITHUB_PATH
13+
shell: bash
14+
- run: echo "${HOME}/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH
15+
shell: bash
16+
17+
- name: Install sonarcloud tools
18+
run: |
19+
sudo apt-get install nodejs curl unzip \
20+
&& curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip \
21+
https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip \
22+
&& unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ \
23+
&& curl --create-dirs -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \
24+
https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip \
25+
&& unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/ \
26+
shell: bash

.github/workflows/test_benchmark_collection_models.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,8 @@ jobs:
3737
with:
3838
fetch-depth: 20
3939

40-
# install dependencies
41-
- name: apt
42-
run: |
43-
sudo apt-get update \
44-
&& sudo apt-get install -y swig libatlas-base-dev
40+
- name: Install apt dependencies
41+
uses: ./.github/actions/install-apt-dependencies
4542

4643
- run: echo "${HOME}/.local/bin/" >> $GITHUB_PATH
4744

.github/workflows/test_install.yml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,14 @@ jobs:
2222

2323
- run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV
2424

25-
# install amici dependencies
25+
- name: Install apt dependencies
26+
uses: ./.github/actions/install-apt-dependencies
27+
2628
- name: apt
2729
run: |
2830
sudo apt-get update \
2931
&& sudo apt-get install -y \
30-
cmake \
31-
g++ \
32-
libatlas-base-dev \
33-
libboost-serialization-dev \
34-
libhdf5-serial-dev \
35-
swig
32+
cmake
3633
3734
- name: Build suitesparse
3835
run: |
@@ -70,16 +67,8 @@ jobs:
7067

7168
- run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV
7269

73-
# install amici dependencies
74-
- name: apt
75-
run: |
76-
sudo apt-get update \
77-
&& sudo apt-get install -y \
78-
g++ \
79-
libatlas-base-dev \
80-
libboost-serialization-dev \
81-
libhdf5-serial-dev \
82-
swig
70+
- name: Install apt dependencies
71+
uses: ./.github/actions/install-apt-dependencies
8372

8473
- name: Create AMICI sdist
8574
run: |

.github/workflows/test_performance.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,9 @@ jobs:
3535
with:
3636
fetch-depth: 20
3737

38-
# install dependencies
39-
- name: apt
40-
run: |
41-
sudo apt-get update \
42-
&& sudo apt-get install -y swig libatlas-base-dev
38+
- name: Install apt dependencies
39+
uses: ./.github/actions/install-apt-dependencies
40+
4341
- run: pip3 install petab shyaml build
4442

4543
- run: echo "${HOME}/.local/bin/" >> $GITHUB_PATH

.github/workflows/test_petab_test_suite.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ jobs:
3434
with:
3535
fetch-depth: 20
3636

37+
- name: Install apt dependencies
38+
uses: ./.github/actions/install-apt-dependencies
39+
3740
# install dependencies
3841
- name: apt
3942
run: |
4043
sudo apt-get update \
41-
&& sudo apt-get install -y \
42-
swig \
43-
libatlas-base-dev \
44-
python3-venv
44+
&& sudo apt-get install -y python3-venv
4545
4646
- name: Build BNGL
4747
run: |

.github/workflows/test_python_cplusplus.yml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,11 @@ jobs:
3535
- run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV
3636
- run: echo "BNGPATH=${GITHUB_WORKSPACE}/ThirdParty/BioNetGen-2.7.0" >> $GITHUB_ENV
3737

38-
# sonar cloud
39-
- run: echo "SONAR_SCANNER_VERSION=5.0.1.3006" >> $GITHUB_ENV
40-
- run: echo "SONAR_SCANNER_HOME=${HOME}/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux" >> $GITHUB_ENV
41-
- run: echo "SONAR_SCANNER_OPTS=-server" >> $GITHUB_ENV
42-
- run: echo "${SONAR_SCANNER_HOME}/bin" >> $GITHUB_PATH
43-
- run: echo "${HOME}/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH
44-
45-
# TODO: add to ci image
46-
- name: Install sonarcloud tools
47-
run: |
48-
sudo apt-get install nodejs curl unzip \
49-
&& curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip \
50-
https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip \
51-
&& unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ \
52-
&& curl --create-dirs -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \
53-
https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip \
54-
&& unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/ \
38+
- name: Set up Sonar tools
39+
uses: ./.github/actions/setup-sonar-tools
40+
41+
- name: Install apt dependencies
42+
uses: ./.github/actions/install-apt-dependencies
5543

5644
# install amici dependencies
5745
- name: apt
@@ -60,12 +48,7 @@ jobs:
6048
&& sudo apt-get install -y \
6149
cmake \
6250
g++ \
63-
libatlas-base-dev \
64-
libboost-serialization-dev \
65-
libboost-chrono-dev \
66-
libhdf5-serial-dev \
6751
python3-venv \
68-
swig \
6952
lcov \
7053
libboost-math-dev
7154

.github/workflows/test_python_ver_matrix.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,8 @@ jobs:
4141
with:
4242
fetch-depth: 20
4343

44-
# install dependencies
45-
- name: apt
46-
run: |
47-
sudo apt-get update \
48-
&& sudo apt-get install -y \
49-
swig \
50-
libatlas-base-dev \
51-
libhdf5-serial-dev \
52-
libboost-math-dev
44+
- name: Install apt dependencies
45+
uses: ./.github/actions/install-apt-dependencies
5346

5447
# install AMICI
5548
- name: Build BNGL

.github/workflows/test_sbml_semantic_test_suite.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ jobs:
4040
- uses: actions/checkout@v3
4141
with:
4242
fetch-depth: 1
43-
- name: apt
44-
run: |
45-
sudo apt-get update \
46-
&& sudo apt-get install -y swig4.0 libatlas-base-dev
43+
44+
- name: Install apt dependencies
45+
uses: ./.github/actions/install-apt-dependencies
46+
4747
- run: AMICI_PARALLEL_COMPILE=2 ./scripts/installAmiciSource.sh
4848
- run: AMICI_PARALLEL_COMPILE=2 ./scripts/run-SBMLTestsuite.sh ${{ matrix.cases }}
4949

.github/workflows/test_valgrind.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,17 @@ jobs:
3434
- uses: actions/checkout@v3
3535
- run: git fetch --prune --unshallow
3636

37+
- name: Install apt dependencies
38+
uses: ./.github/actions/install-apt-dependencies
39+
3740
# install amici dependencies
3841
- name: apt
3942
run: |
4043
sudo apt-get update \
4144
&& sudo apt-get install -y \
4245
cmake \
43-
g++ \
44-
libatlas-base-dev \
45-
libboost-serialization-dev \
46-
libhdf5-serial-dev \
4746
python3-venv \
48-
swig \
49-
valgrind \
50-
libboost-math-dev
47+
valgrind
5148
5249
- name: Build AMICI
5350
run: |
@@ -78,20 +75,17 @@ jobs:
7875
- uses: actions/checkout@v3
7976
- run: git fetch --prune --unshallow
8077

78+
- name: Install apt dependencies
79+
uses: ./.github/actions/install-apt-dependencies
80+
8181
# install amici dependencies
8282
- name: apt
8383
run: |
8484
sudo apt-get update \
8585
&& sudo apt-get install -y \
8686
cmake \
87-
g++ \
88-
libatlas-base-dev \
89-
libboost-serialization-dev \
90-
libhdf5-serial-dev \
9187
python3-venv \
92-
swig \
93-
valgrind \
94-
libboost-math-dev
88+
valgrind
9589
9690
- name: Build AMICI
9791
run: |

0 commit comments

Comments
 (0)