ReaderForSelfoss-multiplatform/.gitea/workflows/on_push_testing.yml

83 lines
2.8 KiB
YAML
Raw Normal View History

2024-12-21 20:02:56 +00:00
name: Check master code
on:
push:
branches:
- testing
jobs:
checkout:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
2024-12-22 20:05:47 +00:00
with:
fetch-depth: 0
- name: Fetch tags
run: git fetch --tags -p
2024-12-21 20:02:56 +00:00
- name: Init compose
uses: KengoTODA/actions-setup-docker-compose@v1
with:
version: "2.23.3"
- name: run selfoss
run: |
docker compose -f .gitea/workflows/assets/docker-compose.yml up -d
2024-12-22 20:05:47 +00:00
sleep 1m
2024-12-21 20:02:56 +00:00
response=$(curl 172.17.0.1:8888/api/about)
echo $response
2024-12-22 20:05:47 +00:00
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: gradle
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Configure gradle...
run: mkdir -p ~/.gradle && echo "org.gradle.daemon=false\nignoreGitVersion=true" >> ~/.gradle/gradle.properties
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-33
- 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: 33
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: ui tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 33
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
arch: x86_64
script: adb shell am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS && ./gradlew connectedAndroidTest
- name: Artifacts
uses: actions/upload-artifact@v3
if: failure()
with:
name: ui-tests
path: androidApp/build
if-no-files-found: error
retention-days: 5
overwrite: true
include-hidden-files: true
- name: Test Summary
uses: test-summary/action@v2
with:
paths: |
androidApp/build/outputs/androidTest-results/connected/debug/flavors/githubConfig/**/TEST-*.xml
androidApp/build/test-results/testGithubConfig*/*.xml
if: failure()
2024-12-21 20:02:56 +00:00
- name: Clean
2024-12-22 20:05:47 +00:00
if: always()
2024-12-21 20:02:56 +00:00
run: |
2024-12-22 20:05:47 +00:00
docker compose -f .gitea/workflows/assets/docker-compose.yml stop