forked from hapjs-platform/hapjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
51 lines (49 loc) · 2.01 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
pipeline {
options {
timeout(time: 1, unit: 'HOURS')
}
agent {
docker {
image 'gengjiawen/android-ndk:qa-2020-07-31'
args '-v /gradle/.gradle:/root/.gradle -v $HOME/.npm:/root/.npm'
}
}
stages {
stage('Build and Test Android') {
steps {
sh 'npx envinfo'
sh 'git clean -xdf'
sh 'git tag -d $(git tag)'
sh 'git log -6 --oneline'
sh 'cd $WORKSPACE/mockup/platform/android && ./gradlew --no-daemon clean assemblePhoneDebug assemblePhoneRelease'
sh 'cd $WORKSPACE/mockup/platform/android && ./gradlew --no-daemon clean assembleTvDebug assembleTvRelease'
archiveArtifacts 'mockup/platform/android/app/build/outputs/apk/**'
}
}
stage('Build and Test Frontend') {
steps {
sh 'npx envinfo'
sh 'cd $WORKSPACE/core/framework && npm install && npm run build && npm run test:suite'
}
}
stage('Quality Check') {
steps {
sh 'cd $WORKSPACE/mockup/platform/android && ./gradlew --no-daemon spotbugs clean lintPhoneDebug lintTvDebug'
}
}
stage('Analysis Report') {
steps {
script {
spotbugs = scanForIssues tool: spotBugs(pattern: 'mockup/platform/android/build/reports/spotbugs*.xml'),
filters: [includePackage('org.hapjs.*'), excludeFile('R.java')]
}
publishIssues name: 'Spotbugs', issues: [spotbugs]
script {
androidLint = scanForIssues tool: androidLintParser(pattern: 'mockup/platform/android/build/reports/lint-results*.xml')
}
publishIssues name: 'Android Lint', issues: [androidLint]
publishIssues id: 'analysis', name: 'All Issues', issues: [spotbugs, androidLint], failedNewHigh: 1
}
}
}
}