[focus] No issue: Use API 30 (Pixel 3) in contributor workflow
[gecko.git] / mobile / android / focus-android / .github / workflows / build-contributor-pr.yml
blobf4f7169bd612532ed9b9317f7fe1cbd42c3d9043
1 name: Android build PR
2 on: [pull_request]
3 jobs:
4   run-build:
5     runs-on: ubuntu-20.04
6     if: github.event.pull_request.head.repo.full_name != github.repository && github.actor != 'MickeyMoz'
7     steps:
8       - name: Checkout repository
9         uses: actions/checkout@v2
10       - name: Setup Java
11         uses: actions/setup-java@v1
12         with:
13           java-version: 11
14       - name: "Clean & Assemble Debug"
15         uses: eskatos/gradle-command-action@v1
16         with:
17           wrapper-cache-enabled: true
18           dependencies-cache-enabled: true
19           configuration-cache-enabled: true
20           arguments: clean app:assembleDebug
22   run-testDebugUnitTest:
23     runs-on: ubuntu-20.04
24     if: github.event.pull_request.head.repo.full_name != github.repository && github.actor != 'MickeyMoz'
26     steps:
27       - name: Checkout repository
28         uses: actions/checkout@v2
29       - name: Setup Java
30         uses: actions/setup-java@v1
31         with:
32           java-version: 11
33       - name: "Test Debug Unit Tests"
34         uses: eskatos/gradle-command-action@v1
35         with:
36           wrapper-cache-enabled: true
37           dependencies-cache-enabled: true
38           configuration-cache-enabled: true
39           arguments: testFocusDebugUnitTest
41   run-detekt:
42     runs-on: ubuntu-20.04
43     if: github.event.pull_request.head.repo.full_name != github.repository && github.actor != 'MickeyMoz'
45     steps:
46       - name: Checkout repository
47         uses: actions/checkout@v2
48       - name: Setup Java
49         uses: actions/setup-java@v1
50         with:
51           java-version: 11
52       - name: "Detekt"
53         uses: eskatos/gradle-command-action@v1
54         with:
55           wrapper-cache-enabled: true
56           dependencies-cache-enabled: true
57           configuration-cache-enabled: true
58           arguments: detekt
59       - name: Archive detekt results
60         uses: actions/upload-artifact@v2
61         with:
62           name: detekt report
63           path: build/reports/detekt.html
65   run-ktlint:
66     runs-on: ubuntu-20.04
67     if: github.event.pull_request.head.repo.full_name != github.repository && github.actor != 'MickeyMoz'
69     steps:
70       - name: Checkout repository
71         uses: actions/checkout@v2
72       - name: Setup Java
73         uses: actions/setup-java@v1
74         with:
75           java-version: 11
76       - name: "Ktlint"
77         uses: eskatos/gradle-command-action@v1
78         with:
79           wrapper-cache-enabled: true
80           dependencies-cache-enabled: true
81           configuration-cache-enabled: true
82           arguments: ktlint
84   run-lintDebug:
85     runs-on: ubuntu-20.04
86     if: github.event.pull_request.head.repo.full_name != github.repository && github.actor != 'MickeyMoz'
88     steps:
89       - name: Checkout repository
90         uses: actions/checkout@v2
91       - name: Setup Java
92         uses: actions/setup-java@v1
93         with:
94           java-version: 11
95       - name: "Lint Debug"
96         uses: eskatos/gradle-command-action@v1
97         with:
98           wrapper-cache-enabled: true
99           dependencies-cache-enabled: true
100           configuration-cache-enabled: true
101           arguments: lintDebug
102       - name: Archive lint results
103         uses: actions/upload-artifact@v2
104         with:
105           name: lintDebug report
106           path: app/build/reports/lint-results-debug.html
108   run-ui:
109     runs-on: macos-11
110     if: github.event.pull_request.head.repo.full_name != github.repository && github.actor != 'MickeyMoz'
112     timeout-minutes: 60
113     strategy:
114       matrix:
115         api-level: [30]
116         target: [google_apis]
117     steps:
118       - name: Checkout
119         uses: actions/checkout@v2
120       - name: Run subset of UI Tests
121         uses: reactivecircus/android-emulator-runner@v2
122         with:
123           api-level: ${{ matrix.api-level }}
124           target: ${{ matrix.target }}
125           arch: x86_64
126           profile: pixel_3
127           script:
128             "JAVA_HOME=$JAVA_HOME_11_X64 && ./gradlew connectedFocusDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=\
129             org.mozilla.focus.activity.ThreeDotMainMenuTest#browserMenuItemsTest"
130       - name: Upload Test Artifacts
131         uses: actions/upload-artifact@v2
132         with:
133           name: test-report
134           path: app/build/reports