-
Notifications
You must be signed in to change notification settings - Fork 1.3k
126 lines (124 loc) · 4.89 KB
/
pr-check.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: PR Check
on:
pull_request:
branches: [ master ]
jobs:
build-and-test-on-macos:
runs-on: macos-latest
strategy:
matrix:
include:
- api-level: 16 #16是最低支持的API
arch: x86
- api-level: 28 #28是项目长期使用的测试API
arch: x86_64
- api-level: 31 #31是目前最新的稳定API
arch: x86_64
env:
DISABLE_TENCENT_MAVEN_MIRROR: true
steps:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v3.x
- name: checkout
uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
cache: 'gradle'
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: revert gradle wrapper mirror setting
run: echo 'distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip' > gradle/wrapper/gradle-wrapper.properties
- name: buildSdk
run: ./gradlew buildSdk -S
- name: build sample/source
run: ./gradlew build
- name: unit test
run: ./gradlew jvmTestSdk -S
- name: run androidTestSdk
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
emulator-build: 8420304
target: default
arch: ${{ matrix.arch }}
profile: pixel_xl
script: ./gradlew androidTestSdk
- name: stop gradle deamon for actions/cache
run: ./gradlew --stop
build-on-windows:
runs-on: windows-latest
env:
DISABLE_TENCENT_MAVEN_MIRROR: true
steps:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v3.x
- name: checkout
uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
cache: 'gradle'
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: revert gradle wrapper mirror setting
run: echo 'distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip' > gradle/wrapper/gradle-wrapper.properties
- name: buildSdk
run: ./gradlew buildSdk -S
- name: build sample/source
run: ./gradlew build
- name: stop gradle deamon for actions/cache
run: ./gradlew --stop
build-samples:
runs-on: ubuntu-latest
env:
DISABLE_TENCENT_MAVEN_MIRROR: true
steps:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v3.x
- name: checkout
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: revert gradle wrapper mirror setting
run: echo 'distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip' > gradle/wrapper/gradle-wrapper.properties
- name: revert gradle wrapper mirror setting for sample host-project
working-directory: projects/sample/maven/host-project
run: echo 'distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip' > gradle/wrapper/gradle-wrapper.properties
- name: revert gradle wrapper mirror setting for sample manager-project
working-directory: projects/sample/maven/manager-project
run: echo 'distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip' > gradle/wrapper/gradle-wrapper.properties
- name: revert gradle wrapper mirror setting for sample plugin-project
working-directory: projects/sample/maven/plugin-project
run: echo 'distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip' > gradle/wrapper/gradle-wrapper.properties
- name: build sample/maven/host-project
working-directory: projects/sample/maven/host-project
run: ./gradlew assemble
- name: build sample/maven/manager-project
working-directory: projects/sample/maven/manager-project
run: ./gradlew assemble
- name: build sample/maven/plugin-project
working-directory: projects/sample/maven/plugin-project
run: ./gradlew assemble
- name: stop gradle deamon for actions/cache
run: ./gradlew --stop