Skip to content

Build

Build #38

Workflow file for this run

name: Build
on:
push:
branches:
- main # or the name of your main branch
- release**
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
sonarqube:
name: SonarQubeAnalysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: JamieBriersSageCom/setup-pmd@v2
with:
pmd-version: '6.52.0'
- name: run-pmd
run: pmd -d $GITHUB_WORKSPACE/src -R $GITHUB_WORKSPACE/pmd-quick.xml --force-language apex -f xml --fail-on-violation false -r $GITHUB_WORKSPACE/pmd.xml
env:
PMD_JAVA_OPTS: -Xmx2g
- name: updatePmd
run: awk '{gsub("/home/.*salesforce-apex-example/", "/github/workspace/");print}' $GITHUB_WORKSPACE/pmd.xml > $GITHUB_WORKSPACE/pmdnew.xml
- name: check-pmd-new
run: cat $GITHUB_WORKSPACE/pmdnew.xml
- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
with:
args: >
-Dsonar.projectName=Salesforce-Apex-Example
-Dsonar.projectKey=SonarSource-Demos_salesforce-apex-example
-Dsonar.verbose=true
-Dsonar.apex.pmd.reportPaths=pmdnew.xml