-
Notifications
You must be signed in to change notification settings - Fork 25
66 lines (59 loc) · 1.77 KB
/
android-develop-pullrequest.yml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Develop Branch Pull Request CI
on:
pull_request:
branches:
- develop
jobs:
test:
name: CI Testing
runs-on: ubuntu-latest
steps:
- name: Get PR number
uses: actions/[email protected]
with:
github-token: ${{github.token}}
script: |
const core = require('@actions/core')
const prNumber = context.payload.number;
core.exportVariable('PULL_NUMBER', prNumber);
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Fetch all branches
run: |
git fetch --prune --unshallow
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Clean, Build
run: bash ./gradlew clean assemble --stacktrace
- name: Lint
run: bash ./gradlew lint
- name: Test
run: bash ./gradlew app:test
- name: Update SonarQube
env:
LOGIN_KEY: ${{ secrets.SONARCLOUD_LOGIN_KEY }}
PR_BRANCH: github.event.pull_request.head.ref
run: bash ./gradlew sonarqube -Dsonar.login=$LOGIN_KEY -Dsonar.pullrequest.branch=$PR_BRANCH -Dsonar.pullrequest.base=develop -Dsonar.pullrequest.key=$PULL_NUMBER --stacktrace
apk:
name: Generate APK
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build debug APK
run: bash ./gradlew assembleDebug --stacktrace
- name: Upload APK
uses: actions/upload-artifact@v1
with:
name: app
path: app/build/outputs/apk/debug/app-debug.apk