-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBrowserStack-ParallelDevicesAtTime(3devices).yml
More file actions
117 lines (100 loc) · 3.74 KB
/
Copy pathBrowserStack-ParallelDevicesAtTime(3devices).yml
File metadata and controls
117 lines (100 loc) · 3.74 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
106
107
108
109
110
111
112
113
114
115
116
name: BrowserStack Parallel Devices
on:
workflow_dispatch:
inputs:
filter:
description: 'Filter for tests'
required: true
default: '@Smoke and @Automated'
jobs:
test:
runs-on: ubuntu-22.04
container: crowdar/lippia:3.3.0.0-jdk17
environment: Automation
strategy:
matrix:
device:
- "Samsung Galaxy A11"
- "Samsung Galaxy A51"
- "Motorola Moto G71 5G"
fail-fast: false # Esto permite que si un trabajo falla, los otros continúen ejecutándose
env:
BSUSER: ${{ secrets.BSUSER }}
AUTHTOKEN: ${{ secrets.AUTHTOKEN }}
BSDEVICE: ${{ matrix.device }}
BSAPP: ${{ secrets.BSAPP }}
LTM_GENERAL: ${{ secrets.LTM_GENERAL }}
LTM_GENERAL_PASS: ${{ secrets.LTM_GENERAL_PASS }}
steps:
- name: Checkout to the repository
uses: actions/checkout@v4
- name: Configuring JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Set Android version based on selected device
run: |
case "${{ matrix.device }}" in
"Samsung Galaxy A11") echo "BSOS=10" >> $GITHUB_ENV ;;
"Samsung Galaxy A51") echo "BSOS=10" >> $GITHUB_ENV ;;
"Motorola Moto G71 5G") echo "BSOS=11" >> $GITHUB_ENV ;;
esac
- name: Configure Maven settings
run: |
mkdir -p ~/.m2
echo '<settings>
<mirrors>
<mirror>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
</settings>' > ~/.m2/settings.xml
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Checking Maven dependencies
run: mvn dependency:resolve
- name: Setting environment variable
run: echo "COMBINED_FILTER=${{ github.event.inputs.filter }}" >> $GITHUB_ENV
- name: Debugging environment variables
run: |
echo "BSDEVICE: $BSDEVICE"
echo "BSOS: $BSOS"
echo "BSUSER: $BSUSER"
echo "AUTHTOKEN: $AUTHTOKEN"
echo "BSAPP: $BSAPP"
echo "LTM_GENERAL: $LTM_GENERAL"
echo "LTM_GENERAL_PASS: $LTM_GENERAL_PASS"
- name: Running Maven clean test
run: |
echo "Running tests with filter: '$COMBINED_FILTER' on device: '$BSDEVICE' with OS version: '$BSOS'"
mvn clean test -Dcrowdar.cucumber.filter="'$COMBINED_FILTER'" \
-Denv.BSDEVICE="${{ matrix.device }}" \
-Denv.BSOS="$BSOS" \
-DTEST_MANAGER_RUN_NAME="AUTO-${{ matrix.device }}-${{ github.event.inputs.filter }}" \
-DLTM_GENERAL="${{ secrets.LTM_GENERAL }}" \
-DLTM_GENERAL_PASS="${{ secrets.LTM_GENERAL_PASS }}" \
-PBrowserStack -PAndroid -U
shell: bash
- name: Uploading test reports
uses: actions/upload-artifact@v4.3.4
with:
name: test-results-${{ matrix.device }}
path: target/reports/
- name: Uploading HTML test report
uses: actions/upload-artifact@v4.3.4
with:
name: html-report-${{ matrix.device }}
path: target/cucumber-reports/cucumber-html-report/*.html
- name: Uploading surefire test reports
uses: actions/upload-artifact@v4.3.4
with:
name: test-results-surefire-${{ matrix.device }}
path: target/surefire-reports/