-
Notifications
You must be signed in to change notification settings - Fork 12
IT Setup
Open https://sonarcloud.io/organizations/applibgroup/projects as admin
Press '+' button near profile icon > Analyze new project
Select a project in applib group repo > Set Up
With GitHub actions > Under GitHub Secret, Copy the Name and Value Fields
Select Project > Configure Analysis > With GitHub actions > Copy the Name and Value Fields
Open https://github.com/applibgroup/circularprogressview as admin Go to Project > Settings > Secrets > New Repository Secret
Enter the copied values from Sonarcloud
Edit build.gradle in the root directory and add the below lines of code
apply plugin: 'org.sonarqube'
apply plugin: 'checkstyle'
buildscript {
dependencies {
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.3"
}
}
allprojects {
repositories {
maven {
url 'https://mirrors.huaweicloud.com/repository/maven/'
}
maven {
url 'https://developer.huawei.com/repo/'
}
jcenter()
}
task checkstyle(type: Checkstyle) {
showViolations = true
configFile file("huawei/config/checkstyle.xml")
source 'entry/src/main/java'
source 'circularprogressview/src/main/java'
include '**/*.java'
// empty classpath
classpath = files()
}
}
checkstyle {
toolVersion "8.43"
}
sonarqube {
properties {
property "sonar.projectKey", "applibgroup_CircularProgressView"
property "sonar.organization", "applibgroup"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.sources", "entry,circularprogressview"
property "sonar.java.binaries", "entry/build,circularprogressview/build"
}
}
Make sure to replace your project name and source paths accordingly
After repo is created and all the code is added. click on the Actions in Project page and select "set up a work flow yourself"
Add the below code to main.yml file
# This workflow will build a Harmony OS project with Gradle and analyse the code using Sonar cloud.
name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
Hmos_Build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: set environment variables
uses: allenevans/set-env@v2.0.0
with:
OHOS_SDK_HOME: '${{ github.workspace }}\huawei'
- name: Download HMOS SDK
uses: actions/checkout@main
with:
repository: applibgroup/HarmonyOsSdk
path: huawei
- 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: Hmos Build and analyze code
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew assembleDebug checkstyle sonarqube --info
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: assets-for-download
path: build\outputs\hap\debug\phone
Once committed, you can find the code in "CircularProgressView/.github/workflows/main.yml"
SonarCloud and Quality gate Setup steps
- Getting Started
- Importance of libraries
- Code of conduct
- Becoming a committer
- Communication Channels
- Self-Learning Courses
- JavaScript in HarmonyOS
- Current Project status and links
- Contributing Guidelines
- Developer Self-Check
- Reviewer Checklist
- SonarQube for static and dynamic code check
- Porting Project to New IDE
- Development Flow
- Release to HPM
- IT Setup
- FAQ
- CircleImageView
- TickerView
- DialogV3
- Glide
- Lottie
- SquareMenu
- SwitchView
- WaveSideBar
- SlidingDrawer
- FloatingGroupExpandableListView
- FloatingActionButton
- MaterialDialogs
- OkGo
- SimpleCropView
- OhosGifDrawable
- Confetti
- CircularProgressView
- CalenderListView
- AnimationEasingFunction
- StickyListHeader
- AnyShape
- DottedProgressBar
- ENViews
- FlycoTabLayout
- MessageView
- RxPreferences
- Toasty
- ViewPageIndicator
- HorizontalProgressBar
- FlexboxLayout
- OkIO
- OkHttp
- LargeImage
- Thrift
- RocketChat
- Retrofit
- Lucene