-
Notifications
You must be signed in to change notification settings - Fork 3.6k
99 lines (80 loc) · 2.91 KB
/
TestConfigurationSample.yaml
File metadata and controls
99 lines (80 loc) · 2.91 KB
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
name: TestConfigurationSample
on:
push:
branches:
- main
paths:
- 'TestConfigurationSample/**'
pull_request:
paths:
- 'TestConfigurationSample/**'
env:
SAMPLE_PATH: TestConfigurationSample
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Generate cache key
run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ hashFiles('checksum.txt') }}
- name: Build project and run local tests
working-directory: ${{ env.SAMPLE_PATH }}
run: ./gradlew spotlessCheck assembleDebug lintDebug testDebug --stacktrace --no-build-cache --rerun-tasks
gradleManagedVirtualDevicesTest:
needs: build
runs-on: macos-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Generate cache key for Gradle cache
run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ hashFiles('checksum.txt') }}
- name: Cache pixel2api29 system image
uses: actions/cache@v2
with:
path: ~/.android/gradle/avd/dev29_aosp_x86_Pixel_2.*
key: pixel2api29
- name: Run all tests
working-directory: ${{ env.SAMPLE_PATH }}
run: ./gradlew pixel2api29DebugAndroidTest
# - name: Run regression tests
# working-directory: ${{ env.SAMPLE_PATH }}
# run: ./gradlew -i pixel2api26DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.example.android.testing.testconfigurationsample.TestDeviceApi26
#
# - name: Run large screen tests
# working-directory: ${{ env.SAMPLE_PATH }}
# run: ./gradlew -i nexus9api29DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.example.android.testing.testconfigurationsample.TestDeviceLargeScreen
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v2
with:
name: test-reports
path: ${{ env.SAMPLE_PATH }}/app/build/reports/androidTests