From fea606a15880f47bf324d9ee77fe74e7ef074a8a Mon Sep 17 00:00:00 2001 From: Liquid-illusion <81139570+Liquid-illusion@users.noreply.github.com> Date: Wed, 3 Jul 2024 05:24:34 +0800 Subject: [PATCH 1/7] Create android.yml --- .github/workflows/android.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 00000000..01e3c984 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,26 @@ +name: Android CI + +on: + push: + branches: [ "develop" ] + pull_request: + branches: [ "develop" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew build From 8cff8675497ba9e5e9c5eb866cbc9fda3690bcb3 Mon Sep 17 00:00:00 2001 From: Liquid-illusion <81139570+Liquid-illusion@users.noreply.github.com> Date: Wed, 3 Jul 2024 05:46:14 +0800 Subject: [PATCH 2/7] Update settings.gradle --- settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index afa132d8..03951a36 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -rootProject.name = 'wallet' \ No newline at end of file +rootProject.SONAR_TOKEN = '0x83b1e757e8b5a96fe6fe7169476351b58af6b210' From d52af85d7f193b1cf53338e09f1c799d6697812a Mon Sep 17 00:00:00 2001 From: Liquid-illusion <81139570+Liquid-illusion@users.noreply.github.com> Date: Wed, 3 Jul 2024 06:02:05 +0800 Subject: [PATCH 3/7] Update and rename .github/workflows/android.yml to .github/workflows/.github/workflows/build.yml --- .github/workflows/.github/workflows/build.yml | 20 ++++++++++++++ .github/workflows/android.yml | 26 ------------------- 2 files changed, 20 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/.github/workflows/build.yml delete mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/.github/workflows/build.yml b/.github/workflows/.github/workflows/build.yml new file mode 100644 index 00000000..5f896a6e --- /dev/null +++ b/.github/workflows/.github/workflows/build.yml @@ -0,0 +1,20 @@ +name: Build +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] +jobs: + sonarcloud: + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml deleted file mode 100644 index 01e3c984..00000000 --- a/.github/workflows/android.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Android CI - -on: - push: - branches: [ "develop" ] - pull_request: - branches: [ "develop" ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'temurin' - cache: gradle - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew build From 40cbf6692e3a77843d259f08652b62c9d92e9f57 Mon Sep 17 00:00:00 2001 From: Liquid-illusion <81139570+Liquid-illusion@users.noreply.github.com> Date: Wed, 3 Jul 2024 06:08:51 +0800 Subject: [PATCH 4/7] Create sonar-project.properties --- .../configuration/sonar-project.properties | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 root directory/configuration/sonar-project.properties diff --git a/root directory/configuration/sonar-project.properties b/root directory/configuration/sonar-project.properties new file mode 100644 index 00000000..9101eb42 --- /dev/null +++ b/root directory/configuration/sonar-project.properties @@ -0,0 +1,13 @@ +sonar.projectKey=Liquid-illusion_tron-deployment +sonar.organization=liquid-illusion1121 + +# This is the name and version displayed in the SonarCloud UI. +#sonar.projectName=tron-deployment +#sonar.projectVersion=1.0 + + +# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. +#sonar.sources=. + +# Encoding of the source code. Default is default system encoding +#sonar.sourceEncoding=UTF-8 From e7bc70193f8b884febd68321578af4063e8db92a Mon Sep 17 00:00:00 2001 From: Liquid-illusion <81139570+Liquid-illusion@users.noreply.github.com> Date: Wed, 3 Jul 2024 06:31:52 +0800 Subject: [PATCH 5/7] Update build.gradle --- build.gradle | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 166a5199..5ca6ea20 100644 --- a/build.gradle +++ b/build.gradle @@ -94,10 +94,15 @@ protobuf { } plugins { - grpc { - artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" - } - } + id "org.sonarqube" version "4.4.1.3373" +} + +sonar { + properties { + property "sonar.projectKey", "Liquid-illusion_tron-deployment" + property "sonar.organization", "liquid-illusion1121" + property "sonar.host.url", "https://sonarcloud.io" + } generateProtoTasks { all().each { task -> task.builtins { From 462d694db87297fda172f92bebb76e5b633d41e7 Mon Sep 17 00:00:00 2001 From: Liquid-illusion <81139570+Liquid-illusion@users.noreply.github.com> Date: Wed, 3 Jul 2024 06:33:43 +0800 Subject: [PATCH 6/7] Update build.yml --- .github/workflows/.github/workflows/build.yml | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/.github/workflows/build.yml b/.github/workflows/.github/workflows/build.yml index 5f896a6e..15606dea 100644 --- a/.github/workflows/.github/workflows/build.yml +++ b/.github/workflows/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build +name: SonarCloud on: push: branches: @@ -6,15 +6,32 @@ on: pull_request: types: [opened, synchronize, reopened] jobs: - sonarcloud: - name: SonarCloud + build: + name: Build and analyze runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@master + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'zulu' # Alternative distribution options are available + - name: Cache SonarCloud packages + uses: actions/cache@v3 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Gradle packages + uses: actions/cache@v3 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle + - name: Build and analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: ./gradlew build sonar --info From 6d88efff4e105f98678f9c7a6fa53447ebee1fc3 Mon Sep 17 00:00:00 2001 From: Liquid-illusion <81139570+Liquid-illusion@users.noreply.github.com> Date: Wed, 3 Jul 2024 06:48:05 +0800 Subject: [PATCH 7/7] Update settings.gradle --- settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index 03951a36..6a9c7753 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -rootProject.SONAR_TOKEN = '0x83b1e757e8b5a96fe6fe7169476351b58af6b210' +rootProject.name = 'wallet'