-
Notifications
You must be signed in to change notification settings - Fork 9
111 lines (92 loc) · 4.24 KB
/
baseline-profile.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
# Workflow name
name: baseline-profiles
# Workflow title
run-name: ${{ github.actor }} requested a workflow
# This should be a manual trigger so this actions gets executed every time make a new pull request.
# Change this event to what suits your project best.
# Read more at https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
on:
workflow_dispatch:
pull_request:
branches:
- develop
# Environment variables (Optional)
# Small projects might have signingConfigs locally. This could lead to failures on GitHub Actions.
# If that's the case, upload your properties defined locally to GitHub Secrets.
# On your signingConfigs, you can recover GitHub Secrets using: variable = System.getenv("VARIABLE")
# Then uncomment this block properly defining your uploaded variables
# env:
# VARIABLE: ${{ secrets.VARIABLE }}
# Read more at https://docs.github.com/en/actions/security-guides/encrypted-secrets
# Jobs to executed on GitHub machines
jobs:
# Job name
generate-baseline-profiles:
# Operating system where the job gets to be executed
runs-on: macos-latest
# Job steps
steps:
# Checks your code out on the machine
- uses: actions/checkout@v4
# Sets java up
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
# Sets gradle up
- name: Setup Gradle
uses: gradle/[email protected]
# Grants execute permission to gradle (safety step)
- name: Grant Permissions to gradlew
run: chmod +x gradlew
# Cleans managed device if previously settle and space currently is not available
- name: Clean Managed Devices
run: ./gradlew cleanManagedDevices --unused-only
- name: Add Local Properties
env:
API_KEY: ${{ secrets.SENTRY_DSN }}
DATA_STORE_KEY: ${{ secrets.SENTRY_DSN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
DEV_API: ${{ secrets.SENTRY_DSN }}
NEW_API: ${{ secrets.SENTRY_DSN }}
SOPT_DEV_OPERATION_BASE_URL: ${{ secrets.SOPT_DEV_OPERATION_BASE_URL }}
SOPT_OPERATION_BASE_URL: ${{ secrets.SOPT_OPERATION_BASE_URL }}
KEY_ALIAS: ${{ secrets.SENTRY_DSN }}
KEY_PASSWORD: ${{ secrets.SENTRY_DSN }}
STORE_PASSWORD: ${{ secrets.SENTRY_DSN }}
DEV_AMPLITUDE_KEY: ${{ secrets.SENTRY_DSN }}
AMPLITUDE_KEY: ${{ secrets.SENTRY_DSN }}
POKE_DATA_STORE_KEY: ${{ secrets.SENTRY_DSN }}
run: |
echo sentryDsn=\"$SENTRY_DSN\" >> ./local.properties
echo apiKey=\"$API_KEY\" >> ./local.properties
echo dataStoreKey=\"$DATA_STORE_KEY\" >> ./local.properties
echo devOperationApi=\"$SOPT_DEV_OPERATION_BASE_URL\" >> ./local.properties
echo operationApi=\"$SOPT_OPERATION_BASE_URL\" >> ./local.properties
echo devApi=\"$DEV_API\" >> ./local.properties
echo newApi=\"$NEW_API\" >> ./local.properties
echo keyAlias=\"KEY_ALIAS\" >> ./local.properties
echo keyPassword=\"KEY_PASSWORD\" >> ./local.properties
echo storePassword=\"STORE_PASSWORD\" >> ./local.properties
echo devAmplitudeKey=\"$DEV_AMPLITUDE_KEY\" >> ./local.properties
echo amplitudeKey=\"$AMPLITUDE_KEY\" >> ./local.properties
echo pokeDataStoreKey=\"$POKE_DATA_STORE_KEY\" >> ./local.properties
- name: Access Firebase Service
run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > ./app/google-services.json
# Generates Baseline Profile
- name: Generate Baseline Profile
run: |
./gradlew generateBaselineProfile \
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" \
-Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile \
-Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=20 \
-Dorg.gradle.workers.max=4
# Create Pull Request
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: "Generate baseline profiles"
title: "Generate baseline profiles"
delete-branch: true
reviewers: l2hyunwoo
branch: actions/baseline-profiles