forked from facebookarchive/shimmer-android
-
Notifications
You must be signed in to change notification settings - Fork 1
135 lines (107 loc) · 3.38 KB
/
pull_request.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
127
128
129
130
131
132
133
134
135
name: Build project
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/gradle-build-action@v2
- run: ./gradlew projectCodestyle
- run: ./gradlew assemble check --scan
- run: ./gradlew projectCoverage
- run: ./gradlew publishToMavenLocal
- run: git diff --exit-code
- name: Upload test results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: test-results
path: "${{ github.workspace }}/**/build/reports/tests"
- name: Upload jacoco report
uses: actions/upload-artifact@v4
with:
name: jacoco-report
path: "${{ github.workspace }}/**/build/reports/jacoco"
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: lint-results
path: '${{ github.workspace }}/**/build/**/reports/lint-results-*.html'
screenshot-test:
runs-on: macos-latest
strategy:
matrix:
apiVersion: [ 28 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- uses: gradle/gradle-build-action@v2
- uses: actions/setup-python@v5
with:
python-version-file: '.python-version'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install 'Pillow==9.1.1'
- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.apiVersion }}
profile: pixel_xl
target: google_apis
arch: x86
disable-spellchecker: true
working-directory: sample
script: |
adb shell settings put global hidden_api_policy_p_apps 1
adb shell settings put global hidden_api_policy_pre_p_apps 1
adb shell settings put global hidden_api_policy 1
python --version
pip show Pillow
./gradlew verify
- name: Upload tests result
uses: actions/upload-artifact@v4
with:
name: android-tests
path: "${{ github.workspace }}/**/build/*AndroidTest/"
- name: Upload screeenshots
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: screenshots-report
path: "${{ github.workspace }}/**/build/**/failedScreenshots/"
build-sample-app:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- name: Assemble sample app
uses: gradle/gradle-build-action@v2
with:
build-root-directory: sample
arguments: assemble check
- uses: actions/upload-artifact@v4
with:
name: apk
path: sample/app/build/outputs/apk/release/*.apk