-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31243dc
commit 2ff9cf8
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" |