@@ -138,3 +138,115 @@ jobs:
138138 name : ${{ matrix.tool.name }}-report
139139 path : |
140140 catroid/build/reports/html/${{ matrix.tool.name }}.html
141+
142+
143+ ui-tests-main :
144+ name : UI Tests main
145+ runs-on : ubuntu-latest
146+ steps :
147+ - name : checkout
148+ uses : actions/checkout@v4
149+
150+ - name : Setup JDK ${{ env.JAVA_VERSION }}
151+ uses : actions/setup-java@v4
152+ with :
153+ distribution : " temurin"
154+ java-version : ${{ env.JAVA_VERSION }}
155+ cache : gradle
156+
157+ - name : Setup Gradle
158+ uses : gradle/actions/setup-gradle@v4
159+
160+ - name : Set up Android SDK
161+ if : ${{ env.ACT }} # Only run on local act setups, as GitHub Actions provides the Android SDK on Ubuntu
162+ uses : android-actions/setup-android@v2
163+
164+ - name : Install Emulator Dependencies
165+ if : ${{ env.ACT }} # Only run on local act setups, as GitHub Actions provides the dependencies on Ubuntu
166+ run : |
167+ sudo apt-get update
168+ sudo apt-get install -y \
169+ libxtst6 \
170+ libdbus-1-3 \
171+ libpulse0\
172+
173+ #\
174+ #libnss3 \
175+ #libxcomposite1 \
176+ #libxcursor1 \
177+ #libasound2t64 \
178+ #libgl1 \
179+ #libxkbcommon0 \
180+ #libxml2 \
181+ #libgbm1 \
182+ #libxrender1 \
183+ #libglib2.0-0t64
184+ #some dependencies provided by ai but not breaking if left out (maybe unnecessary)
185+
186+ - name : Enable KVM
187+ if : ${{ env.ACT }} # Only run on local act setups, as normal KVM Setup doesn't work there
188+ run : |
189+ # 1. Create the kvm group
190+ sudo groupadd -f kvm
191+
192+ # 2. Add current user to the group
193+ sudo usermod -aG kvm $USER
194+
195+ # 3. Create the rule file (good for documentation, though it might not trigger)
196+ sudo mkdir -p /etc/udev/rules.d/
197+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
198+
199+ # 4. MANUALLY set permissions (This bypasses the need for udevadm reload)
200+ if [ -e /dev/kvm ]; then
201+ sudo chown root:kvm /dev/kvm
202+ sudo chmod 0666 /dev/kvm
203+ echo "Successfully set permissions for /dev/kvm"
204+ else
205+ echo "ERROR: /dev/kvm not found. Did you use the --device flag in act?"
206+ exit 1
207+ fi
208+ #sudo udevadm control --reload-rules
209+ #sudo udevadm trigger --name-match=kvm
210+
211+ - name : Enable KVM Github
212+ if : ${{ !env.ACT }} # Only run on GitHub-hosted runners
213+ run : |
214+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
215+ sudo udevadm control --reload-rules
216+ sudo udevadm trigger --name-match=kvm
217+
218+ - name : run tests
219+ uses : reactivecircus/android-emulator-runner@v2
220+ with :
221+ api-level : 35
222+ force-avd-creation : true
223+ emulator-boot-timeout : 900
224+ emulator-options : >
225+ -no-window
226+ -no-boot-anim
227+ -no-audio
228+ -camera-back none
229+ -camera-front none
230+ -qemu -append panic=1
231+ arch : x86_64
232+ script : |
233+ # 1. Compile
234+ ./gradlew compileCatroidDebugSources compileCatroidDebugAndroidTestSources
235+
236+ # 2. Standard Test-Run without Coverage
237+ ./gradlew disableAnimations -PenableCoverage createCatroidDebugAndroidTestCoverageReport -Pandroid.testInstrumentationRunnerArguments.class=org.catrobat.catroid.testsuites.UiEspressoPullRequestTriggerSuite
238+ continue-on-error : true
239+
240+ - name : Upload Test Reports Folder
241+ uses : actions/upload-artifact@v4
242+ if : always() # IMPORTANT: Upload reports regardless of status
243+ with :
244+ name : reports
245+ path : catroid/build/reports/androidTests/connected/debug/flavors/catroid/
246+
247+ - name : Upload Coverage Report
248+ uses : actions/upload-artifact@v4
249+ if : always() # IMPORTANT: Upload reports regardless of status
250+ with :
251+ name : coverage-report
252+ path : catroid/build/reports/coverage/androidTest/catroid/debug/connected/
0 commit comments