Skip to content

1640 Relationships details overview (#1649) #1344

1640 Relationships details overview (#1649)

1640 Relationships details overview (#1649) #1344

name: SonarCloud Scan [backend]
on:
push:
branches:
- 'main'
pull_request_target:
types: ['opened', 'edited', 'reopened', 'synchronize']
paths:
- 'odd-platform-api/**'
- 'build.gradle'
jobs:
sonar-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- uses: unfor19/install-aws-cli-action@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Gradle cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-shared-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Node cache
uses: actions/cache@v3
with:
path: odd-platform-ui/.npm
key: ${{ runner.os }}-shared-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Build and analyze pull request target
if: ${{ github.event_name == 'pull_request_target' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
HEAD_REF: ${{ github.head_ref }}
BASE_REF: ${{ github.base_ref }}
JAVA_OPTS: "-Xms2048m -Xmx2048m"
run: |
./gradlew -x compileTestJava :odd-platform-api:sonarqube \
--info \
--no-daemon \
--scan \
-PbundleUI=false \
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \
-Dsonar.pullrequest.branch=$HEAD_REF \
-Dsonar.pullrequest.base=$BASE_REF
- name: Build main branch
if: ${{ github.event_name == 'push' }}
env:
GENERATE_SOURCEMAP: false
CI: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
JAVA_OPTS: "-Xms2048m -Xmx2048m"
run: |
./gradlew -x compileTestJava :odd-platform-api:sonarqube \
--info \
--no-daemon \
--scan \
-PbundleUI=false