-
Notifications
You must be signed in to change notification settings - Fork 18
158 lines (153 loc) · 7.22 KB
/
pull-request-check.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# The workflow for feature pull requests before they are merged
on:
pull_request:
branches:
- develop
- release/*
- feature/*
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
android-lint:
name: "Run ktlint check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Initialize project keys"
uses: ./.github/actions/setup-project
with:
amplitude-key-debug: ${{ secrets.AMPLITUDE_KEY_DEBUG }}
amplitude-key-release: ${{ secrets.AMPLITUDE_KEY_RELEASE }}
torus-verifier-debug: ${{ secrets.TORUS_VERIFIER_DEBUG }}
torus-verifier-feature: ${{ secrets.TORUS_VERIFIER_FEATURE }}
torus-sub-verifier-feature: ${{ secrets.TORUS_SUB_VERIFIER_FEATURE }}
torus-verifier-release: ${{ secrets.TORUS_VERIFIER_RELEASE }}
rpc-pool-key: ${{ secrets.RPC_POOL_API_KEY }}
moonpay-key: ${{ secrets.MOONPAY_KEY }}
moonpay-sandbox-key: ${{ secrets.MOONPAY_SANDBOX_KEY }}
intercom-key: ${{ secrets.INTERCOM_API_KEY }}
intercom-app-id: ${{ secrets.INTERCOM_APP_ID }}
apps-flyer-key: ${{ secrets.APPS_FLYER_KEY }}
compare-key: ${{ secrets.COMPARE_PUBLIC_KEY }}
sentry-auth-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
sentry-auth-dsn: ${{ secrets.SENTRY_AUTH_DSN }}
lokalise-key: ${{ secrets.LOKALISE_KEY }}
lokalise-app-id: ${{ secrets.LOKALISE_APP_ID }}
svl-memo-send: ${{ secrets.SVL_MEMO_SEND }}
svl-memo-claim: ${{ secrets.SVL_MEMO_CLAIM }}
salt-prefix: ${{ secrets.SALT_PREFIX }}
- name: Run ktlint
run: ./gradlew ktlint -PautoCorrect=0
android-unit-tests:
name: "Run unit tests"
needs:
- android-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Initializing firebase configs"
uses: ./.github/actions/setup-google-services
with:
google-services-content: ${{ secrets.GOOGLE_SERVICE_JSON_SECRET }}
- name: "Initialize project keys"
uses: ./.github/actions/setup-project
with:
amplitude-key-debug: ${{ secrets.AMPLITUDE_KEY_DEBUG }}
amplitude-key-release: ${{ secrets.AMPLITUDE_KEY_RELEASE }}
torus-verifier-debug: ${{ secrets.TORUS_VERIFIER_DEBUG }}
torus-verifier-feature: ${{ secrets.TORUS_VERIFIER_FEATURE }}
torus-sub-verifier-feature: ${{ secrets.TORUS_SUB_VERIFIER_FEATURE }}
torus-verifier-release: ${{ secrets.TORUS_VERIFIER_RELEASE }}
rpc-pool-key: ${{ secrets.RPC_POOL_API_KEY }}
moonpay-key: ${{ secrets.MOONPAY_KEY }}
moonpay-sandbox-key: ${{ secrets.MOONPAY_SANDBOX_KEY }}
intercom-key: ${{ secrets.INTERCOM_API_KEY }}
intercom-app-id: ${{ secrets.INTERCOM_APP_ID }}
apps-flyer-key: ${{ secrets.APPS_FLYER_KEY }}
compare-key: ${{ secrets.COMPARE_PUBLIC_KEY }}
sentry-auth-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
sentry-auth-dsn: ${{ secrets.SENTRY_AUTH_DSN }}
lokalise-key: ${{ secrets.LOKALISE_KEY }}
lokalise-app-id: ${{ secrets.LOKALISE_APP_ID }}
svl-memo-send: ${{ secrets.SVL_MEMO_SEND }}
svl-memo-claim: ${{ secrets.SVL_MEMO_CLAIM }}
salt-prefix: ${{ secrets.SALT_PREFIX }}
- name: Run unit tests
run: ./gradlew testDebugUnitTest koverXmlReportDebug
- name: Attach coverage to pull request
id: kover-report-task
uses: edwardstock/kover-report@main
with:
path: |
${{ github.workspace }}/app/build/reports/kover/reportDebug.xml
${{ github.workspace }}/core/build/reports/kover/reportDebug.xml
${{ github.workspace }}/token-service/build/reports/kover/reportDebug.xml
token: ${{ secrets.GITHUB_TOKEN }}
title: Code coverage report
update-comment: true
coverage-counter-type: LINE
min-coverage-overall: 80
min-coverage-changed-files: 60
- name: Print coverage information
run: |
echo "Total coverage ${{ steps.kover-report-task.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.kover-report-task.outputs.coverage-changed-files }}"
android-build-artifacts:
name: "Run build feature artifacts"
environment: manual
runs-on: ubuntu-latest
steps:
- name: "Checkout to the current commit hash"
uses: actions/checkout@v3
- name: "Initializing firebase configs"
uses: ./.github/actions/setup-google-services
with:
google-services-content: ${{ secrets.GOOGLE_SERVICE_JSON_SECRET }}
- name: "Initialize project keys"
uses: ./.github/actions/setup-project
with:
amplitude-key-debug: ${{ secrets.AMPLITUDE_KEY_DEBUG }}
amplitude-key-release: ${{ secrets.AMPLITUDE_KEY_RELEASE }}
torus-verifier-debug: ${{ secrets.TORUS_VERIFIER_DEBUG }}
torus-verifier-feature: ${{ secrets.TORUS_VERIFIER_FEATURE }}
torus-sub-verifier-feature: ${{ secrets.TORUS_SUB_VERIFIER_FEATURE }}
torus-verifier-release: ${{ secrets.TORUS_VERIFIER_RELEASE }}
rpc-pool-key: ${{ secrets.RPC_POOL_API_KEY }}
moonpay-key: ${{ secrets.MOONPAY_KEY }}
moonpay-sandbox-key: ${{ secrets.MOONPAY_SANDBOX_KEY }}
intercom-key: ${{ secrets.INTERCOM_API_KEY }}
intercom-app-id: ${{ secrets.INTERCOM_APP_ID }}
apps-flyer-key: ${{ secrets.APPS_FLYER_KEY }}
compare-key: ${{ secrets.COMPARE_PUBLIC_KEY }}
sentry-auth-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
sentry-auth-dsn: ${{ secrets.SENTRY_AUTH_DSN }}
lokalise-key: ${{ secrets.LOKALISE_KEY }}
lokalise-app-id: ${{ secrets.LOKALISE_APP_ID }}
svl-memo-send: ${{ secrets.SVL_MEMO_SEND }}
svl-memo-claim: ${{ secrets.SVL_MEMO_CLAIM }}
salt-prefix: ${{ secrets.SALT_PREFIX }}
- name: "Generate changelog"
uses: ./.github/actions/setup-changelog-pull-request
- name: "Send start deploy message to slack"
run: bash bash_scripts/slack_start_message.sh ${{ secrets.SLACK_BOT_TOKEN }} ${{ secrets.SLACK_CHANNEL_ID }}
- name: "Build feature APK"
run: ./gradlew assembleFeature
- name: "Upload APK to Firebase (Feature)"
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
run: ./gradlew appDistributionUploadFeature
- name: "Upload APK to Slack (Feature)"
uses: ./.github/actions/setup-slack
with:
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
build-type: "feature"
artifact-type: "apk"
- name: "Upload changelog, and Jira ticket to slack channel"
run: bash bash_scripts/slack_upload_changelog.sh ${{ secrets.SLACK_BOT_TOKEN }} ${{ secrets.SLACK_CHANNEL_ID }} CHANGELOG.txt
- name: "Send finish deploy message to slack"
run: |
value=`cat timestamp.txt`
bash bash_scripts/slack_finish_message.sh ${{ secrets.SLACK_BOT_TOKEN }} ${{ secrets.SLACK_CHANNEL_ID }} $value