Skip to content

Bump version to 1.6.1; fix pylint and improving loadlibrary code; add… #138

Bump version to 1.6.1; fix pylint and improving loadlibrary code; add…

Bump version to 1.6.1; fix pylint and improving loadlibrary code; add… #138

Workflow file for this run

name: SonarQube
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Build library
run: |
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y install liblapack-dev cmake libsqlite3-dev
mkdir build
cd build
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr
make
ctest -T Test -T Coverage
sudo make install
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install tox and dependencies
run: sudo apt-get install tox
- name: Run tox
run: |
cd src/python_bindings
tox -e py
sed -i -e 's/<source>libscientific<\/source>/<source>src\/python_bindings\/libscientific<\/source>/' coverage.xml
- name: Download and install the SonarScanner
env:
SONAR_SCANNER_VERSION: 4.6.2.2472
run: |
mkdir $HOME/.sonar
curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
- name: SonarQube Scan
run: |
sonar-scanner --define sonar.cfamily.compile-commands=build/compile_commands.json --define sonar.cfamily.gcov.reportsPath=build/Testing/CoverageInfo/ --define sonar.python.coverage.reportPaths=src/python_bindings/coverage.xml --define sonar.verbose=true
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}