Skip to content

Automatic SonarCloud Scan #3

Automatic SonarCloud Scan

Automatic SonarCloud Scan #3

Workflow file for this run

name: SonarCloud
on:
push:
branches:
- devel
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
# Installing apt dependencies
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libfftw3-dev libopenmpi-dev libhdf5-dev libtiff5-dev python3-numpy python3-dev libsqlite3-dev default-jdk git cmake libopencv-dev openmpi-bin
# Setting up Python
- uses: actions/setup-python@v4
with:
python-version: '3.9.15' # Version range or exact version of a Python version to use, using SemVer's version range syntax
# Installing Python dependencies
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install scons numpy
# Installing CUDA
- uses: Jimver/[email protected]
id: cuda-toolkit
with:
cuda: '11.8.0'
use-github-cache: false
method: network
sub-packages: '["nvcc"]'
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v2
- name: Run build-wrapper
env:
CIBuild: 1
BUILD_TESTS: True
run: |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }}./xmipp -noAsk
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"