-
Notifications
You must be signed in to change notification settings - Fork 3.6k
123 lines (100 loc) · 4.09 KB
/
TestConfigurationSample.yaml
File metadata and controls
123 lines (100 loc) · 4.09 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
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 pixel2api30 system image
uses: actions/cache@v2
with:
path: |
~/.android/gradle/avd/dev30_aosp_x86_Pixel_2.*
~/.android/gradle/avd/dev30_aosp_x86_64_Pixel_2.*
key: pixel2api30
- name: Cache pixel2api27 system image
uses: actions/cache@v2
with:
path: ~/.android/gradle/avd/dev27_aosp_x86_Pixel_2.*
key: pixel2api27
- name: Cache nexus9api29 system image
uses: actions/cache@v2
with:
path: ~/.android/gradle/avd/dev29_aosp_x86_Nexus_9.*
key: nexus9api29
- name: Run all tests
working-directory: ${{ env.SAMPLE_PATH }}
run: ./gradlew -Dorg.gradle.workers.max=2 -i pixel2api30DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.notAnnotation=com.example.android.testing.testconfigurationsample.TestDeviceLargeScreen -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
- name: Run regression tests
working-directory: ${{ env.SAMPLE_PATH }}
run: ./gradlew -Dorg.gradle.workers.max=2 -i pixel2api27DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.example.android.testing.testconfigurationsample.TestDeviceApi27 -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
- name: Run large screen tests
working-directory: ${{ env.SAMPLE_PATH }}
run: ./gradlew -Dorg.gradle.workers.max=2 -i nexus9api29DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.example.android.testing.testconfigurationsample.TestDeviceLargeScreen -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v2
with:
name: test-reports
path: ${{ env.SAMPLE_PATH }}/app/build/reports/androidTests
- name: Upload emulator logs
if: failure()
uses: actions/upload-artifact@v2
with:
name: emulator-logs
path: |
${{ env.SAMPLE_PATH }}/app/build/outputs/androidTest-results/managedDevice/**
!${{ env.SAMPLE_PATH }}/**/*:*.xml
!${{ env.SAMPLE_PATH }}/**/*|*