diff --git a/.github/workflow/build.yml b/.github/workflow/build.yml new file mode 100644 index 0000000..3119854 --- /dev/null +++ b/.github/workflow/build.yml @@ -0,0 +1,20 @@ +name: Build +on: + push: + branches: + - dev + pull_request: + types: [opened, synchronize, reopened] +jobs: + 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: 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 }} \ No newline at end of file diff --git a/.github/workflow/linter.yml b/.github/workflow/linter.yml new file mode 100644 index 0000000..233f1b0 --- /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: [set_up_testing, dev, master] + # Remove the line above to run when pushing to master + pull_request: + branches: [master, main, 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: master + 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 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