Skip to content

Automatic SonarCloud Scan #121

Automatic SonarCloud Scan

Automatic SonarCloud Scan #121

Workflow file for this run

# Workflow name
name: SonarCloud scan
# Specify when the Action should be triggered: when a pull request is opened against the 'devel' or 'master' branch
on:
push:
branches: [devel, master]
pull_request:
branches: [devel, master]
jobs:
build:
runs-on: ubuntu-latest
steps:
# Prepare the enviroment for Sonar scanner
- name: Prepare Sonar scanner
working-directory: ${{ env.BUILD_DIR }}
run: |
wget -nv -O sonar-scanner-cli.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ vars.SONAR_VERSION }}-linux.zip
unzip -q sonar-scanner-cli.zip -d sonar-scanner-cli
mv sonar-scanner-cli/*/* sonar-scanner-cli/
echo "${PWD}/sonar-scanner-cli/bin/" >> $GITHUB_PATH
# Run the SonarCloud Scan
- name: SonarCloud Scan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -Dsonar.organization=i2pc -Dsonar.projectKey=I2PC_xmipp