SongodaCore/.github/workflows/sonarcloud.yml
Christian Koop 00789921a3
Revert "GitHub Actions: Skip automated tests when running SonarCloud"
This reverts commit 59f4adfc6f.

We need the tests to generate the test coverage report. Didn't think of that.
2022-11-26 20:27:20 +01:00

45 lines
1.0 KiB
YAML

name: SonarCloud
on:
push:
branches: [ master, development, development-v3 ]
pull_request:
types: [ opened, synchronize, reopened ]
permissions: read-all
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_PROJECT_KEY: songoda_SongodaCore
jobs:
Analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
if: ${{ env.SONAR_TOKEN != null }}
with:
fetch-depth: 0
- name: Prepare Workspace
if: ${{ env.SONAR_TOKEN != null }}
uses: ./.github/actions/setup_project_workspace
- name: 'Cache: SonarCloud'
if: ${{ env.SONAR_TOKEN != null }}
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
- name: Analyze project
if: ${{ env.SONAR_TOKEN != null }}
run: >
mvn -B \
verify \
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
"-Dsonar.projectKey=$SONAR_PROJECT_KEY"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}