Bug 1814441 - Import fenix configuration in `.mergify.yml`
[gecko.git] / mobile / android / fenix / .github / workflows / build-contributor-pr.yml
blob665c437b97ac6f71a309f63900e0b087c780ba50
1 name: Android build PR
2 on: [pull_request]
3 jobs:
4   run-build:
5     runs-on: ubuntu-20.04
6     if: ${{ false }}
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: testDebugUnitTest
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: ${{ false }}
111     timeout-minutes: 60
112     strategy:
113       matrix:
114         api-level: [28]
115         target: [google_apis]
116     steps:
117       - name: Checkout
118         uses: actions/checkout@v2
119       - name: Run subset of UI Tests
120         uses: reactivecircus/android-emulator-runner@v2.21.0
121         with:
122           api-level: ${{ matrix.api-level }}
123           target: ${{ matrix.target }}
124           arch: x86_64
125           profile: pixel_2
126           script:
127             "JAVA_HOME=$JAVA_HOME_11_X64 && ./gradlew connectedDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=\
128             org.mozilla.fenix.ui.NavigationToolbarTest#visitURLTest"
129       - name: Upload Test Artifacts
130         uses: actions/upload-artifact@v2
131         with:
132           name: test-report
133           path: app/build/reports