Update UI tests #133
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run tests | |
on: [ pull_request ] | |
jobs: | |
build: | |
name: build | |
runs-on: ubuntu-latest | |
env: | |
SKIP_ICS_OPENVPN_BUILD: > | |
--build-cache | |
-x :ics-openvpn-main:configureCMakeRelWithDebInfo[arm64-v8a] | |
-x :ics-openvpn-main:buildCMakeRelWithDebInfo[arm64-v8a] | |
-x :ics-openvpn-main:configureCMakeRelWithDebInfo[armeabi-v7a] | |
-x :ics-openvpn-main:buildCMakeRelWithDebInfo[armeabi-v7a] | |
-x :ics-openvpn-main:configureCMakeRelWithDebInfo[x86] | |
-x :ics-openvpn-main:buildCMakeRelWithDebInfo[x86] | |
-x :ics-openvpn-main:configureCMakeRelWithDebInfo[x86_64] | |
-x :ics-openvpn-main:buildCMakeRelWithDebInfo[x86_64] | |
-x :ics-openvpn-main:externalNativeBuildUiOvpn23Release | |
-x :ics-openvpn-main:packageUiOvpn23ReleaseResources | |
-x :ics-openvpn-main:compileUiOvpn23ReleaseJavaWithJavac | |
-x :ics-openvpn-main:configureCMakeDebug[x86_64] | |
-x :ics-openvpn-main:buildCMakeDebug[x86_64] | |
-x :ics-openvpn-main:buildCMakeDebug[arm64-v8a] | |
-x :ics-openvpn-main:buildCMakeDebug[armeabi-v7a] | |
-x :ics-openvpn-main:buildCMakeDebug[x86] | |
strategy: | |
matrix: | |
api-level: [ 31 ] | |
steps: | |
- name: Maximize build space | |
uses: easimon/maximize-build-space@master | |
with: | |
root-reserve-mb: 2048 | |
temp-reserve-mb: 512 | |
remove-haskell: 'true' | |
remove-docker-images: 'true' | |
remove-codeql: 'true' | |
remove-dotnet: 'true' | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- 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: Install Java 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- name: Cache build | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.gradle | |
app/build | |
key: ${{ runner.os }}-${{ matrix.api-level }}-build-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.api-level }}-build- | |
- name: Cache ics-openvpn build | |
id: cache-ics-openvpn | |
uses: actions/cache@v3 | |
with: | |
path: | | |
ics-openvpn/.gradle | |
ics-openvpn/main/build | |
ics-openvpn/main/.cxx | |
key: ${{ runner.os }}-${{ matrix.api-level }}-ics_openvpn-${{ hashFiles('.git/modules/ics-openvpn/HEAD') }} | |
- if: ${{ steps.cache-ics-openvpn.outputs.cache-hit == 'true' }} | |
# For unknown reason, ninja always rebuilds, so force use of cache | |
name: Build app with ics-openvpn cache | |
run: | | |
./gradlew app:assembleBasicRelease app:assembleBasicDebugAndroidTest \ | |
--warning-mode all $SKIP_ICS_OPENVPN_BUILD | |
- if: ${{ steps.cache-ics-openvpn.outputs.cache-hit != 'true' }} | |
name: Build app | |
run: | | |
#sudo apt-get update | |
#sudo apt-get -y install swig ninja-build cmake | |
./gradlew app:assembleBasicRelease app:assembleBasicDebugAndroidTest \ | |
--build-cache --warning-mode all | |
# Based on https://github.com/marketplace/actions/android-emulator-runner | |
- name: AVD cache | |
uses: actions/cache@v3 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd-${{ matrix.api-level }} | |
- 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: ${{ matrix.api-level }} | |
arch: x86_64 | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: false | |
script: echo "Generated AVD snapshot for caching." | |
- name: Run tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
arch: x86_64 | |
disable-animations: true | |
disk-size: 6000M | |
heap-size: 600M | |
script: ./gradlew connectedCheck -Pandroid.testInstrumentationRunnerArguments.package=nl.eduvpn.app.service $SKIP_ICS_OPENVPN_BUILD | |
- name: Store test reports | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-reports | |
path: '**/build/reports/androidTests' | |
retention-days: 7 | |
if: always() |