Skip to content

Fixing String in echoedData, Adding Deep copy snippet and test #217

Fixing String in echoedData, Adding Deep copy snippet and test

Fixing String in echoedData, Adding Deep copy snippet and test #217

name: Java PR Builder with Gradle and SonarCloud
on:
pull_request_target:
branches: [ master ]
types: [ opened, reopened, synchronize ]
jobs:
build-and-analyze:
name: Build and SonarCloud Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout PR source code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'gradle'
- name: Make Gradle executable
run: chmod +x ./gradlew
- name: Build and analyze with Gradle and SonarCloud
run: |
./gradlew build sonarqube --no-daemon \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.organization=iluwatar \
-Dsonar.projectKey=iluwatar_30-seconds-of-java \
-Dsonar.pullrequest.branch=${{ github.head_ref }} \
-Dsonar.pullrequest.base=${{ github.base_ref }} \
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}