-
-
Notifications
You must be signed in to change notification settings - Fork 435
112 lines (94 loc) · 3.72 KB
/
integration-tests-benchmarks.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
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
name: 'Integration Tests - Benchmarks'
on:
schedule:
- cron: '0 0 * * *' # every night at midnight UTC
pull_request:
paths:
- '**/sentry/**'
- '**/sentry-android/**'
- '**/sentry-android-core/**'
- '**/sentry-android-ndk/**'
- '**/sentry-android-integration-tests/**'
- '**/.github/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Benchmarks
runs-on: ubuntu-latest
# we copy the secret to the env variable in order to access it in the workflow
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: 'Set up Java: 17'
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
with:
gradle-home-cache-cleanup: true
# Clean, build and release a test apk, but only if we will run the benchmark
- name: Make assembleBenchmarks
if: env.SAUCE_USERNAME != null
run: make assembleBenchmarks
- name: Run All Tests in SauceLab
uses: saucelabs/saucectl-run-action@39e4f0666ca8ecb4b60847213c6e0fbd6a0c2bd8 # pin@v3
if: github.event_name != 'pull_request' && env.SAUCE_USERNAME != null
env:
GITHUB_TOKEN: ${{ github.token }}
with:
sauce-username: ${{ secrets.SAUCE_USERNAME }}
sauce-access-key: ${{ secrets.SAUCE_ACCESS_KEY }}
config-file: .sauce/sentry-uitest-android-benchmark.yml
- name: Run one test in SauceLab
uses: saucelabs/saucectl-run-action@39e4f0666ca8ecb4b60847213c6e0fbd6a0c2bd8 # pin@v3
if: github.event_name == 'pull_request' && env.SAUCE_USERNAME != null
env:
GITHUB_TOKEN: ${{ github.token }}
with:
sauce-username: ${{ secrets.SAUCE_USERNAME }}
sauce-access-key: ${{ secrets.SAUCE_ACCESS_KEY }}
config-file: .sauce/sentry-uitest-android-benchmark-lite.yml
app-metrics:
runs-on: ubuntu-latest
# we copy the secret to the env variable in order to access it in the workflow
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: 'Set up Java: 17'
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
with:
gradle-home-cache-cleanup: true
- uses: actions/cache@v4
id: app-plain-cache
with:
path: sentry-android-integration-tests/test-app-plain/build/outputs/apk/release/test-app-plain-release.apk
key: ${{ github.workflow }}-${{ github.job }}-appplain-${{ hashFiles('sentry-android-integration-tests/test-app-plain/**') }}
- name: Build Android app plain
if: steps.app-plain-cache.outputs['cache-hit'] != 'true'
run: ./gradlew :sentry-android-integration-tests:test-app-plain:assembleRelease
- name: Build Android app with Sentry
run: ./gradlew :sentry-android-integration-tests:test-app-sentry:assembleRelease
- name: Collect app metrics
uses: getsentry/action-app-sdk-overhead-metrics@v1
with:
config: sentry-android-integration-tests/metrics-test.yml
sauce-user: ${{ secrets.SAUCE_USERNAME }}
sauce-key: ${{ secrets.SAUCE_ACCESS_KEY }}
if: env.SAUCE_USERNAME != null