-
Notifications
You must be signed in to change notification settings - Fork 87
114 lines (101 loc) · 5.13 KB
/
ci_instrumented_tests.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
name: Instrumented Tests
on:
workflow_dispatch:
inputs:
testTimeoutSeconds:
description: 'Seconds for test timeout'
required: true
default: 120 # should be same as env.TEST_TIMEOUT_SECONDS
pull_request:
branches:
- develop
- master
path:
- 'core/android/**'
- 'protocol/sign/**'
- 'protocol/notify/**'
env:
TEST_TIMEOUT_SECONDS: 120 # Predefined timeout for integration tests
concurrency:
# Support push/pr as event types with different behaviors each:
# 1. push: queue up builds by branch
# 2. pr: only allow one run per PR
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name }}
# If there is already a workflow running for the same pull request, cancel it
# For non-PR triggers queue up builds
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
sdk_tests:
name: Run Instrumented Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check what modules were changed
id: what_modules_changed
shell: bash
run: |
check_changes() {
local module_path=$1
local output_variable_name=$2
changes=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- "$module_path/")
if [ -n "$changes" ]; then
echo "${output_variable_name}=true" >> $GITHUB_OUTPUT
echo "${output_variable_name}=true"
else
echo "${output_variable_name}=false" >> $GITHUB_OUTPUT
echo "${output_variable_name}=false"
fi
}
check_changes "core/android" "CORE_MODULE_CHANGED"
check_changes "protocol/sign" "SIGN_MODULE_CHANGED"
check_changes "protocol/notify" "NOTIFY_MODULE_CHANGED"
- name: Setup Required files to build SDKs
with:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
FIREBASE_SERVICE_CREDENTIALS: ${{ secrets.FIREBASE_SERVICE_CREDENTIALS }}
SECRETS_PROPERTIES: ${{ secrets.SECRETS_PROPERTIES }}
ENCODED_STRING_DEBUG: ${{ secrets.WC_KOTLIN_DEBUG_KEYSTORE }}
SIGNING_KEY_STORE_PATH_DEBUG: ${{ secrets.WC_KOTLIN_DEBUG_KEYSTORE_PATH }}
ENCODED_STRING_INTERNAL: ${{ secrets.WC_KOTLIN_INTERNAL_KEYSTORE }}
SIGNING_KEY_STORE_PATH_INTERNAL: ${{ secrets.WC_KOTLIN_INTERNAL_KEYSTORE_PATH }}
ENCODED_STRING_UPLOAD: ${{ secrets.WC_KOTLIN_UPLOAD_KEYSTORE }}
SIGNING_KEY_STORE_PATH_UPLOAD: ${{ secrets.WC_KOTLIN_UPLOAD_KEYSTORE_PATH }}
uses: ./.github/actions/ci_setup
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Run Core instrumented tests
if: ${{ steps.what_modules_changed.outputs.CORE_MODULE_CHANGED == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/actions/ci_instrumented_tests
with:
name: "Android_Core_SDK"
command: ":core:android:allDevicesCheck"
projectId: ${{ secrets.WC_CLOUD_PROJECT_ID }}
notifyProjectId: ${{ secrets.NOTIFY_INTEGRATION_TESTS_PROJECT_ID }}
notifySecret: ${{ secrets.NOTIFY_INTEGRATION_TESTS_SECRET }}
testTimeoutSeconds: ${{ github.event.inputs.testTimeoutSeconds || env.TEST_TIMEOUT_SECONDS }} # Prioritise dispatch input timeout over env one
- name: Run Sign instrumented tests
if: ${{ steps.what_modules_changed.outputs.CORE_MODULE_CHANGED == 'true' || steps.what_modules_changed.outputs.SIGN_MODULE_CHANGED == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/actions/ci_instrumented_tests
with:
name: "Sign_SDK"
command: ":protocol:sign:allDevicesCheck"
projectId: ${{ secrets.WC_CLOUD_PROJECT_ID }}
notifyProjectId: ${{ secrets.NOTIFY_INTEGRATION_TESTS_PROJECT_ID }}
notifySecret: ${{ secrets.NOTIFY_INTEGRATION_TESTS_SECRET }}
testTimeoutSeconds: ${{ github.event.inputs.testTimeoutSeconds || env.TEST_TIMEOUT_SECONDS }} # Prioritise dispatch input timeout over env one
- name: Run Notify instrumented tests
if: false
# if: ${{ steps.what_modules_changed.outputs.CORE_MODULE_CHANGED == 'true' || steps.what_modules_changed.outputs.NOTIFY_MODULE_CHANGED == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/actions/ci_instrumented_tests
with:
name: "Notify_SDK"
command: ":protocol:notify:allDevicesCheck"
projectId: ${{ secrets.WC_CLOUD_PROJECT_ID }}
notifyProjectId: ${{ secrets.NOTIFY_INTEGRATION_TESTS_PROJECT_ID }}
notifySecret: ${{ secrets.NOTIFY_INTEGRATION_TESTS_SECRET }}
testTimeoutSeconds: ${{ github.event.inputs.testTimeoutSeconds || env.TEST_TIMEOUT_SECONDS }} # Prioritise dispatch input timeout over env one