From 11c5e994134503403043dcc16a72420e0838a432 Mon Sep 17 00:00:00 2001 From: kamil Date: Mon, 20 Jun 2022 13:18:08 +0300 Subject: [PATCH 01/11] Set up build.yml --- .github/workflow/build.yml | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflow/build.yml diff --git a/.github/workflow/build.yml b/.github/workflow/build.yml new file mode 100644 index 0000000..bb1bc77 --- /dev/null +++ b/.github/workflow/build.yml @@ -0,0 +1,55 @@ +--- +################################# +################################# +## Super Linter GitHub Actions ## +################################# +################################# +name: Lint Code Base + +# +# Documentation: +# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions +# + +############################# +# Start the job on all push # +############################# +on: + push: + branches-ignore: [adding_voice_commands] + # Remove the line above to run when pushing to adding_voice_commands + pull_request: + branches: [adding_voice_commands] + +############### +# Set the Job # +############### +jobs: + build: + # Name the Job + name: Lint Code Base + # Set the agent to run on + runs-on: ubuntu-latest + + ################## + # Load all steps # + ################## + steps: + ########################## + # Checkout the code base # + ########################## + - name: Checkout Code + uses: actions/checkout@v3 + with: + # Full git history is needed to get a proper list of changed files within `super-linter` + fetch-depth: 0 + + ################################ + # Run Linter against code base # + ################################ + - name: Lint Code Base + uses: github/super-linter@v4 + env: + VALIDATE_ALL_CODEBASE: true + DEFAULT_BRANCH: adding_voice_commands + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From e0b85bb6323e67b2830df7c006e85a57cadecfb0 Mon Sep 17 00:00:00 2001 From: kamil Date: Mon, 20 Jun 2022 13:19:08 +0300 Subject: [PATCH 02/11] Set up build.yml 2 --- .github/workflow/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflow/build.yml b/.github/workflow/build.yml index bb1bc77..fed61a5 100644 --- a/.github/workflow/build.yml +++ b/.github/workflow/build.yml @@ -16,10 +16,10 @@ name: Lint Code Base ############################# on: push: - branches-ignore: [adding_voice_commands] - # Remove the line above to run when pushing to adding_voice_commands + branches-ignore: [dev] + # Remove the line above to run when pushing to dev pull_request: - branches: [adding_voice_commands] + branches: [dev] ############### # Set the Job # @@ -51,5 +51,5 @@ jobs: uses: github/super-linter@v4 env: VALIDATE_ALL_CODEBASE: true - DEFAULT_BRANCH: adding_voice_commands + DEFAULT_BRANCH: dev GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From ca23d2a60dd7826b962ac11bfa17f05b8ae71e50 Mon Sep 17 00:00:00 2001 From: kamil Date: Mon, 20 Jun 2022 13:22:03 +0300 Subject: [PATCH 03/11] Set up build.yml 3 --- .github/workflow/{build.yml => linter.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflow/{build.yml => linter.yml} (100%) diff --git a/.github/workflow/build.yml b/.github/workflow/linter.yml similarity index 100% rename from .github/workflow/build.yml rename to .github/workflow/linter.yml From a9d3327de804e60ed1973a1d77b5e801846265fc Mon Sep 17 00:00:00 2001 From: kamil Date: Mon, 20 Jun 2022 13:25:06 +0300 Subject: [PATCH 04/11] Set up build.yml 4 --- .github/workflow/build.yml | 36 ++++++++++++++++++++++++ .github/workflow/linter.yml | 55 ------------------------------------- android/build.gradle | 14 ++++++++++ 3 files changed, 50 insertions(+), 55 deletions(-) create mode 100644 .github/workflow/build.yml delete mode 100644 .github/workflow/linter.yml diff --git a/.github/workflow/build.yml b/.github/workflow/build.yml new file mode 100644 index 0000000..c9ea785 --- /dev/null +++ b/.github/workflow/build.yml @@ -0,0 +1,36 @@ +name: Build +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache SonarCloud packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Gradle packages + uses: actions/cache@v1 + 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 sonarqube --info \ No newline at end of file diff --git a/.github/workflow/linter.yml b/.github/workflow/linter.yml deleted file mode 100644 index fed61a5..0000000 --- a/.github/workflow/linter.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -################################# -################################# -## Super Linter GitHub Actions ## -################################# -################################# -name: Lint Code Base - -# -# Documentation: -# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions -# - -############################# -# Start the job on all push # -############################# -on: - push: - branches-ignore: [dev] - # Remove the line above to run when pushing to dev - pull_request: - branches: [dev] - -############### -# Set the Job # -############### -jobs: - build: - # Name the Job - name: Lint Code Base - # Set the agent to run on - runs-on: ubuntu-latest - - ################## - # Load all steps # - ################## - steps: - ########################## - # Checkout the code base # - ########################## - - name: Checkout Code - uses: actions/checkout@v3 - with: - # Full git history is needed to get a proper list of changed files within `super-linter` - fetch-depth: 0 - - ################################ - # Run Linter against code base # - ################################ - - name: Lint Code Base - uses: github/super-linter@v4 - env: - VALIDATE_ALL_CODEBASE: true - DEFAULT_BRANCH: dev - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 83ae220..a5bcb5b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -11,6 +11,8 @@ buildscript { } } + + allprojects { repositories { google() @@ -29,3 +31,15 @@ subprojects { task clean(type: Delete) { delete rootProject.buildDir } + +plugins { + id "org.sonarqube" version "3.4.0.2513" +} + +sonarqube { + properties { + property "sonar.projectKey", "memorizer-b21-05" + property "sonar.organization", "memorizer-b21-05" + property "sonar.host.url", "https://sonarcloud.io" + } +} \ No newline at end of file From 7f1ea577a91157f2b099f54724f61c17558e4ad2 Mon Sep 17 00:00:00 2001 From: kamil Date: Mon, 20 Jun 2022 13:28:11 +0300 Subject: [PATCH 05/11] Set up build.yml 5 --- .github/workflow/build.yml | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/.github/workflow/build.yml b/.github/workflow/build.yml index c9ea785..3119854 100644 --- a/.github/workflow/build.yml +++ b/.github/workflow/build.yml @@ -2,35 +2,19 @@ name: Build on: push: branches: - - master + - dev pull_request: types: [opened, synchronize, reopened] jobs: - build: - name: Build + sonarcloud: + name: SonarCloud runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - name: Cache SonarCloud packages - uses: actions/cache@v1 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - name: Cache Gradle packages - uses: actions/cache@v1 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: ${{ runner.os }}-gradle - - name: Build and analyze + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@dev env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: ./gradlew build sonarqube --info \ No newline at end of file + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file From 74346ab88f347e717aa74122a7841a6a7b98f308 Mon Sep 17 00:00:00 2001 From: kamil Date: Mon, 20 Jun 2022 13:29:42 +0300 Subject: [PATCH 06/11] Set up build.yml 6 --- sonar-project.properties | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 sonar-project.properties diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..318c52b --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,12 @@ +sonar.projectKey=memorizer-b21-05 +sonar.organization=memorizer-b21-05 + +# This is the name and version displayed in the SonarCloud UI. +#sonar.projectName=memorizer-b21-05 +#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 \ No newline at end of file From 5c04849926e47167c20db3825821815c363766cc Mon Sep 17 00:00:00 2001 From: kamil Date: Mon, 20 Jun 2022 13:39:35 +0300 Subject: [PATCH 07/11] Set up linter.yml --- .github/workflow/linter.yml | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflow/linter.yml diff --git a/.github/workflow/linter.yml b/.github/workflow/linter.yml new file mode 100644 index 0000000..be1b9af --- /dev/null +++ b/.github/workflow/linter.yml @@ -0,0 +1,55 @@ +--- +################################# +################################# +## Super Linter GitHub Actions ## +################################# +################################# +name: Lint Code Base + +# +# Documentation: +# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions +# + +############################# +# Start the job on all push # +############################# +on: + push: + branches-ignore: [master, main] + # Remove the line above to run when pushing to master + pull_request: + branches: [master, main] + +############### +# Set the Job # +############### +jobs: + build: + # Name the Job + name: Lint Code Base + # Set the agent to run on + runs-on: ubuntu-latest + + ################## + # Load all steps # + ################## + steps: + ########################## + # Checkout the code base # + ########################## + - name: Checkout Code + uses: actions/checkout@v3 + with: + # Full git history is needed to get a proper list of changed files within `super-linter` + fetch-depth: 0 + + ################################ + # Run Linter against code base # + ################################ + - name: Lint Code Base + uses: github/super-linter@v4 + env: + VALIDATE_ALL_CODEBASE: false + DEFAULT_BRANCH: master + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From fca849e72a737478bf7e0cd6411aa2231cf2a472 Mon Sep 17 00:00:00 2001 From: kamil Date: Mon, 20 Jun 2022 13:40:51 +0300 Subject: [PATCH 08/11] Set up linter.yml 2 --- .github/workflow/linter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflow/linter.yml b/.github/workflow/linter.yml index be1b9af..e734a01 100644 --- a/.github/workflow/linter.yml +++ b/.github/workflow/linter.yml @@ -16,10 +16,10 @@ name: Lint Code Base ############################# on: push: - branches-ignore: [master, main] + branches-ignore: [master, main, dev] # Remove the line above to run when pushing to master pull_request: - branches: [master, main] + branches: [master, main, dev] ############### # Set the Job # From 40a7db4925a82672a9acc66efe08b94a03a055ce Mon Sep 17 00:00:00 2001 From: kamil Date: Mon, 20 Jun 2022 13:43:41 +0300 Subject: [PATCH 09/11] Set up linter.yml 3 --- .github/workflow/linter.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflow/linter.yml b/.github/workflow/linter.yml index e734a01..f0d0495 100644 --- a/.github/workflow/linter.yml +++ b/.github/workflow/linter.yml @@ -16,7 +16,6 @@ name: Lint Code Base ############################# on: push: - branches-ignore: [master, main, dev] # Remove the line above to run when pushing to master pull_request: branches: [master, main, dev] @@ -50,6 +49,6 @@ jobs: - name: Lint Code Base uses: github/super-linter@v4 env: - VALIDATE_ALL_CODEBASE: false + VALIDATE_ALL_CODEBASE: true DEFAULT_BRANCH: master GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 8f4c28eec62672b0a2e1784a467945e86cdaf1c9 Mon Sep 17 00:00:00 2001 From: kamil Date: Mon, 20 Jun 2022 13:45:24 +0300 Subject: [PATCH 10/11] Set up linter.yml 3 --- .github/workflow/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflow/linter.yml b/.github/workflow/linter.yml index f0d0495..9e1a5b4 100644 --- a/.github/workflow/linter.yml +++ b/.github/workflow/linter.yml @@ -50,5 +50,5 @@ jobs: uses: github/super-linter@v4 env: VALIDATE_ALL_CODEBASE: true - DEFAULT_BRANCH: master + DEFAULT_BRANCH: dev GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 29d50338c77673b1c348c036b3e4acda59cc9bb3 Mon Sep 17 00:00:00 2001 From: kamil Date: Mon, 20 Jun 2022 13:47:34 +0300 Subject: [PATCH 11/11] Set up linter.yml 3 --- .github/workflow/linter.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflow/linter.yml b/.github/workflow/linter.yml index 9e1a5b4..233f1b0 100644 --- a/.github/workflow/linter.yml +++ b/.github/workflow/linter.yml @@ -16,6 +16,7 @@ name: Lint Code Base ############################# on: push: + branches: [set_up_testing, dev, master] # Remove the line above to run when pushing to master pull_request: branches: [master, main, dev] @@ -50,5 +51,5 @@ jobs: uses: github/super-linter@v4 env: VALIDATE_ALL_CODEBASE: true - DEFAULT_BRANCH: dev + DEFAULT_BRANCH: master GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file