Skip to content

refactor: separate responsabilities in CarbonEstimator #28

refactor: separate responsabilities in CarbonEstimator

refactor: separate responsabilities in CarbonEstimator #28

Workflow file for this run

name: SonarCloud analysis
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
sonar:
name: Build, Test (JaCoCo) and SonarCloud
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: SonarCloud analyze (push) - non-blocking
if: github.event_name != 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: >-
cd domain && mvn verify && mvn -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.organization=${{ vars.SONAR_ORG }}
-Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }}
-Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml
-Dsonar.qualitygate.wait=false
- name: SonarCloud analyze
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: >-
cd domain && mvn verify && mvn -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.organization=${{ vars.SONAR_ORG }}
-Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }}
-Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml
-Dsonar.qualitygate.wait=true