Skip to content

Make this reppo uptodate/runnable #1

Make this reppo uptodate/runnable

Make this reppo uptodate/runnable #1

Workflow file for this run

name: Sonarqube code analysis
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
application:
required: false
type: choice
default: ""
description: Specific application to analyze
options:
- ""
- Appserver
- Frontend
jobs:
sonarqube:
name: Quality of ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: appserver
path: appserver
extraArgs: >
-Dsonar.tests=tests/
-Dsonar.exclusions=tests/**
- name: frontend
path: client
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
# Check if code was changed in project path
- name: Check code changes
uses: marceloprado/has-changed-path@v1
if: github.event_name != 'workflow_dispatch'
id: changed
with:
paths: ${{ matrix.path }}
# Scan if code was changed or if workflow was triggered manually
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
if: steps.changed.outputs.changed == 'true' || github.event.inputs.application == matrix.name || github.event.inputs.application == ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_ORGANIZATION: lifelike
with:
projectBaseDir: ${{ matrix.path }}
args: >
-Dsonar.organization=${{ env.SONAR_ORGANIZATION }}
-Dsonar.projectKey=${{ env.SONAR_ORGANIZATION }}-${{ matrix.name }}
-Dsonar.projectName=${{ matrix.name }}
${{ matrix.extraArgs }}