Skip to content

Commit

Permalink
Test full SonarCloud scan
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSalinas98 authored Aug 30, 2023
1 parent 31243dc commit 2ff9cf8
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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.7.0'
linux-local-args: '[ "--toolkit" ]'

- 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 }}"

0 comments on commit 2ff9cf8

Please sign in to comment.