-
-
Notifications
You must be signed in to change notification settings - Fork 402
82 lines (71 loc) · 2.82 KB
/
assemble-test-lint.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
name: Android CI
# Avoid running this on the gh-pages branch
on:
push:
branches-ignore:
- "gh-pages"
pull_request:
branches-ignore:
- "gh-pages"
workflow_dispatch: # Allow running manually from web UI
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
# Only run on pushes or if pull request from fork
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
permissions:
checks: write # to publish unit test results
steps:
- name: Check out
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up JDK 21
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: Gradle info
run: ./gradlew -version
# Note: Currently no difference between flavors or debug and release
# Note: running tests will also compile
- name: Build and run unit tests
run: ./gradlew :app:testPureDebugUnitTest
- name: Test Report
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5 # v1.9.1
if: always() # also run if tests failed
with:
name: JUnit Report
path: app/build/test-results/**/*.xml
reporter: java-junit
lint:
name: Lint
runs-on: ubuntu-latest
# Only run on pushes or if pull request from fork
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- name: Check out
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up JDK 21
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
# To speed up lint check only run for release variant and only on app module
# Note: the app module has lintOptions.checkDependencies true, so submodules will be checked
# Source: https://groups.google.com/forum/#!topic/lint-dev/RGTvK_uHQGQ
# Note: running lint will also compile
- name: Lint goog release
run: ./gradlew :app:lintPureRelease
- name: Lint amzn release
if: ${{ contains(github.ref, 'release') }}
run: ./gradlew :app:lintAmazonRelease
- name: Upload lint reports
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: ${{ always() }} # also upload of lint errors
with:
name: Lint reports
path: |
app/build/reports/lint-results-pureRelease.html
app/build/reports/lint-results-amazonRelease.html