Skip to content

Commit

Permalink
sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Nov 15, 2023
1 parent f97e038 commit 9b227a8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 28 deletions.
33 changes: 22 additions & 11 deletions .github/actions/setup-sonar-tools/action.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
name: Install apt dependencies
description: Install apt dependencies for the AMICI Python package
name: Set up Sonar tools
description: Download and install sonar-scanner and build-wrapper
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
- run: echo "SONAR_SCANNER_VERSION=5.0.1.3006" >> $GITHUB_ENV
shell: bash
- run: echo "SONAR_SCANNER_HOME=${HOME}/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux" >> $GITHUB_ENV
shell: bash
- run: echo "SONAR_SCANNER_OPTS=-server" >> $GITHUB_ENV
shell: bash
- run: echo "${SONAR_SCANNER_HOME}/bin" >> $GITHUB_PATH
shell: bash
- run: echo "${HOME}/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH
shell: bash

- name: Install sonarcloud tools
run: |
sudo apt-get install nodejs curl unzip \
&& curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip \
https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip \
&& unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ \
&& curl --create-dirs -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \
https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip \
&& unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/ \
shell: bash
19 changes: 2 additions & 17 deletions .github/workflows/test_python_cplusplus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,8 @@ jobs:
- run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV
- run: echo "BNGPATH=${GITHUB_WORKSPACE}/ThirdParty/BioNetGen-2.7.0" >> $GITHUB_ENV

# sonar cloud
- run: echo "SONAR_SCANNER_VERSION=5.0.1.3006" >> $GITHUB_ENV
- run: echo "SONAR_SCANNER_HOME=${HOME}/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux" >> $GITHUB_ENV
- run: echo "SONAR_SCANNER_OPTS=-server" >> $GITHUB_ENV
- run: echo "${SONAR_SCANNER_HOME}/bin" >> $GITHUB_PATH
- run: echo "${HOME}/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH

# TODO: add to ci image
- name: Install sonarcloud tools
run: |
sudo apt-get install nodejs curl unzip \
&& curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip \
https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip \
&& unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ \
&& curl --create-dirs -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \
https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip \
&& unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/ \
- name: Set up Sonar tools
uses: ./.github/actions/setup-sonar-tools

- name: Install apt dependencies
uses: ./.github/actions/install-apt-dependencies
Expand Down

0 comments on commit 9b227a8

Please sign in to comment.