From 2597c293420e6984e424884cce01fb1174ee1593 Mon Sep 17 00:00:00 2001 From: kamil Date: Mon, 20 Jun 2022 13:34:59 +0300 Subject: [PATCH 1/5] Set up linter.yml --- .github/workflows/linter.yml | 55 ++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/linter.yml diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..be1b9af --- /dev/null +++ b/.github/workflows/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 7bb0f86a8230fb0c5e2da20303b412217275e9e5 Mon Sep 17 00:00:00 2001 From: kamil Date: Mon, 20 Jun 2022 13:54:19 +0300 Subject: [PATCH 2/5] build.yml and build.gradle --- .github/workflows/build.yml | 36 ++++++++++++++++++++++++++++++++++++ android/build.gradle | 12 ++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c9ea785 --- /dev/null +++ b/.github/workflows/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/android/build.gradle b/android/build.gradle index 83ae220..a4e3d84 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -29,3 +29,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 0f291537c1db5148383686d99a9f3e851e21082c Mon Sep 17 00:00:00 2001 From: kamil Date: Mon, 20 Jun 2022 13:59:33 +0300 Subject: [PATCH 3/5] build.yml and properties --- .github/workflows/build.yml | 26 +++++--------------------- sonar-project.properties | 12 ++++++++++++ 2 files changed, 17 insertions(+), 21 deletions(-) create mode 100644 sonar-project.properties diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c9ea785..43d8350 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,31 +6,15 @@ on: 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@master 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 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 1213c1320cf438a1cfa03be1a9a46eebe5c73ce8 Mon Sep 17 00:00:00 2001 From: kamil Date: Mon, 20 Jun 2022 14:03:19 +0300 Subject: [PATCH 4/5] update properties --- sonar-project.properties | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sonar-project.properties b/sonar-project.properties index 318c52b..cd8cd60 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -7,6 +7,9 @@ sonar.organization=memorizer-b21-05 # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. #sonar.sources=. +sonar.c.file.suffixes=- +sonar.cpp.file.suffixes=- +sonar.objc.file.suffixes=- # Encoding of the source code. Default is default system encoding #sonar.sourceEncoding=UTF-8 \ No newline at end of file From 6b1192fa1cb73e3e157176abf613463dbde0ebb8 Mon Sep 17 00:00:00 2001 From: kamil Date: Mon, 20 Jun 2022 14:08:17 +0300 Subject: [PATCH 5/5] update build --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 43d8350..e91417d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,7 @@ on: push: branches: - master + - dev pull_request: types: [opened, synchronize, reopened] jobs: