forked from cucumber/cucumber-jvm-starter-maven-java
-
Notifications
You must be signed in to change notification settings - Fork 2
105 lines (91 loc) · 3.16 KB
/
Copy pathe2etests.yml
File metadata and controls
105 lines (91 loc) · 3.16 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
name: Execute tests
on:
workflow_call:
inputs:
apk:
description: '.apk to execute'
type: string
backend:
description: 'type of backend'
type: string
tag:
description: 'filter tags to execute'
type: string
default: 'not @ignore and not @noocis and not @noci'
secrets:
oc_server_url:
description: 'server url'
jobs:
run_tests:
name: Run Emulator & Execute Tests & Artifacts
runs-on: ubuntu-latest
env:
OC_SERVER_URL: ${{ secrets.oc_server_url }}
BACKEND: ${{ inputs.backend }}
steps:
- name: Checkout current repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
# Uploaded in the above
- name: Download APK
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c #v8.0.1
with:
name: ${{ inputs.apk }}
path: ./src/test/resources
# Improves emulator's performance by using hardware acceleration
- name: Enable KVM
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: Start Appium
run: |
mkdir -p logs video
chmod +x ./runAppium.sh
./runAppium.sh
- name: Run Emulator & Tests
uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a #v2.37.0
id: execution
with:
api-level: 31
target: google_apis
arch: x86_64
profile: pixel_5
avd-name: test-avd
force-avd-creation: true
disable-animations: true
emulator-options: -no-snapshot -no-window -no-audio -no-boot-anim -accel on -memory 3072
# Ignored tests, no oCIS tests and no CI tests will not run
script: ./executeTests -t "${{ inputs.tag }}"
- name: Upload html report
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
if: always()
with:
name: report
path: target
- name: Sanitize log filenames
if: always()
run: |
# Replace ':' with '-' because upload-artifact rejects those paths.
find ./logs -depth -name '*:*' | while IFS= read -r file; do
dir="$(dirname "$file")"
base="$(basename "$file")"
safe_base="${base//:/-}"
final_path="$dir/$safe_base"
mv "$file" "$final_path"
echo "Sanitized log filename: $final_path"
done
- name: Upload Execution Log
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
with:
name: logs
path: ./logs
- name: Zip video files
if: always()
run: zip -r -9 test-recordings.zip video
- name: Upload Video
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
with:
name: video
path: ./test-recordings.zip