-
-
Notifications
You must be signed in to change notification settings - Fork 2
178 lines (157 loc) · 5.41 KB
/
build.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: Build
on:
push:
branches: [ "develop", "feature/**", "bugfix/**" ]
pull_request:
branches: [ "develop" ]
types: [ opened, reopened, edited ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.VERSION }}
steps:
- name: Free Disk Space
shell: bash
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4.0.0
with:
java-version: 21
distribution: temurin
cache: maven
- name: Build Spectrum
shell: bash
run: ./mvnw install -DskipSign -Dmaven.plugin.validation=NONE -ntp -P framework-only
- name: Get Spectrum version
id: get-version
run: |
VERSION=$( ./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout )
echo "Spectrum version is $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Store Spectrum jar
uses: actions/upload-artifact@v4
with:
name: spectrum-jar
path: spectrum/target/spectrum-${{ env.VERSION }}.jar
browsers:
name: Browsers IT
needs: build
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
include:
- os: ubuntu-latest
profiles: browsers
directives: -DbrowsersTests
env:
EDGE_BINARY: /usr/bin/microsoft-edge
- os: macos-latest
profiles: macos
directives: -DmacosTests
env:
EDGE_BINARY: /usr/bin/microsoft-edge
- os: windows-latest
profiles: browsers
directives: -DbrowsersTests
runs-on: ${{ matrix.os }}
env:
VERSION: ${{ needs.build.outputs.version }}
steps:
- name: Free Disk Space
if: ${{ matrix.os != 'windows-latest' }}
shell: bash
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4.0.0
with:
java-version: 21
distribution: temurin
cache: maven
- name: Get Spectrum jar
uses: actions/download-artifact@v4
with:
name: spectrum-jar
- name: Run browsers ITs
shell: bash
run: |
./mvnw install:install-file -ntp -Dfile=$GITHUB_WORKSPACE/spectrum-${{ env.VERSION }}.jar -DgroupId=io.github.giulong -DartifactId=spectrum -Dversion=${{ env.VERSION }} -Dpackaging=jar
./mvnw install -DskipSign -Dmaven.plugin.validation=NONE ${{ matrix.directives }} -ntp -P ${{ matrix.profiles }}
appium:
name: Appium IT
needs: build
runs-on: ubuntu-latest
env:
VERSION: ${{ needs.build.outputs.version }}
steps:
- name: Free Disk Space
shell: bash
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4.0.0
with:
java-version: 21
distribution: temurin
cache: maven
- 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: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd
- name: Install and Run Appium Server
run: |
npm i -g appium
appium driver install uiautomator2
appium &>/dev/null &
- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 31
arch: x86_64
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: echo "Generated AVD snapshot for caching."
- name: Get Spectrum jar
uses: actions/download-artifact@v4
with:
name: spectrum-jar
- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 31
arch: x86_64
avd-name: phone
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: |
./mvnw install:install-file -ntp -Dfile=$GITHUB_WORKSPACE/spectrum-${{ env.VERSION }}.jar -DgroupId=io.github.giulong -DartifactId=spectrum -Dversion=${{ env.VERSION }} -Dpackaging=jar
./mvnw install -DskipSign -Denforcer.skip -Dmaven.plugin.validation=NONE -DappiumTests -ntp -P appium