Compare commits
1 Commits
c477a6f684
...
cdd3964e6b
Author | SHA1 | Date | |
---|---|---|---|
cdd3964e6b |
@ -1,8 +1,5 @@
|
|||||||
name: PR test
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
workflow_call:
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
integrationTests:
|
integrationTests:
|
||||||
@ -12,29 +9,44 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Fetch tags
|
- name: "Check android app changes"
|
||||||
run: git fetch --tags -p
|
id: check-android-changes
|
||||||
- uses: KengoTODA/actions-setup-docker-compose@v1
|
uses: tj-actions/changed-files@v45
|
||||||
with:
|
with:
|
||||||
version: "2.23.3"
|
files: |
|
||||||
- name: run selfoss
|
androidApp/src/**
|
||||||
run: |
|
shared/src/commonMain/**
|
||||||
docker compose -f .gitea/workflows/assets/docker-compose.yml up -d
|
shared/src/androidMain/**
|
||||||
|
shared/src/commonTest/**
|
||||||
|
- name: Fetch tags
|
||||||
|
if: steps.check-android-changes.outputs.any_modified == 'true'
|
||||||
|
run: git fetch --tags -p
|
||||||
- uses: actions/setup-java@v4
|
- uses: actions/setup-java@v4
|
||||||
|
if: steps.check-android-changes.outputs.any_modified == 'true'
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
- uses: gradle/actions/setup-gradle@v3
|
- uses: gradle/actions/setup-gradle@v3
|
||||||
|
if: steps.check-android-changes.outputs.any_modified == 'true'
|
||||||
- uses: android-actions/setup-android@v3
|
- uses: android-actions/setup-android@v3
|
||||||
|
if: steps.check-android-changes.outputs.any_modified == 'true'
|
||||||
- name: Configure gradle...
|
- name: Configure gradle...
|
||||||
|
if: steps.check-android-changes.outputs.any_modified == 'true'
|
||||||
run: mkdir -p ~/.gradle && echo "org.gradle.daemon=false\nignoreGitVersion=true" >> ~/.gradle/gradle.properties
|
run: mkdir -p ~/.gradle && echo "org.gradle.daemon=false\nignoreGitVersion=true" >> ~/.gradle/gradle.properties
|
||||||
- name: Change url until I find a better way to do it
|
- name: Change url until I find a better way to do it
|
||||||
|
if: steps.check-android-changes.outputs.any_modified == 'true'
|
||||||
run: |
|
run: |
|
||||||
sed -i "s/const DEFAULT_URL = \"http:\/\/10\.0\.2\.2\:8888\"/const DEFAULT_URL = \"http:\/\/172\.17\.0\.1\:8888\"/g" ./androidApp/src/androidTest/kotlin/bou/amine/apps/readerforselfossv2/android/CommonTests.kt
|
sed -i "s/const DEFAULT_URL = \"http:\/\/10\.0\.2\.2\:8888\"/const DEFAULT_URL = \"http:\/\/172\.17\.0\.1\:8888\"/g" ./androidApp/src/androidTest/kotlin/bou/amine/apps/readerforselfossv2/android/CommonTests.kt
|
||||||
echo '-----------'
|
- uses: KengoTODA/actions-setup-docker-compose@v1
|
||||||
cat ./androidApp/src/androidTest/kotlin/bou/amine/apps/readerforselfossv2/android/CommonTests.kt
|
if: steps.check-android-changes.outputs.any_modified == 'true'
|
||||||
echo '-----------'
|
with:
|
||||||
|
version: "2.23.3"
|
||||||
|
- name: run selfoss
|
||||||
|
if: steps.check-android-changes.outputs.any_modified == 'true'
|
||||||
|
run: |
|
||||||
|
docker compose -f .gitea/workflows/assets/docker-compose.yml up -d
|
||||||
- name: Tests
|
- name: Tests
|
||||||
|
if: steps.check-android-changes.outputs.any_modified == 'true'
|
||||||
uses: reactivecircus/android-emulator-runner@v2
|
uses: reactivecircus/android-emulator-runner@v2
|
||||||
with:
|
with:
|
||||||
api-level: 29
|
api-level: 29
|
||||||
@ -45,6 +57,7 @@ jobs:
|
|||||||
adb logcat -G 16M
|
adb logcat -G 16M
|
||||||
./gradlew JacocoDebugCodeCoverage || (./gradlew androidApp:fetchScreenshots && adb logcat 'InputReader:S' 'chatty:S' 'audio_hw_generic:S' 'LogApiCalls:D' '*:I' -d > ./androidApp/build/reports/androidTests/connected/screenshots/logs.txt)
|
./gradlew JacocoDebugCodeCoverage || (./gradlew androidApp:fetchScreenshots && adb logcat 'InputReader:S' 'chatty:S' 'audio_hw_generic:S' 'LogApiCalls:D' '*:I' -d > ./androidApp/build/reports/androidTests/connected/screenshots/logs.txt)
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
|
if: steps.check-android-changes.outputs.any_modified == 'true'
|
||||||
with:
|
with:
|
||||||
name: screenshot-espresso
|
name: screenshot-espresso
|
||||||
path: androidApp/build/reports/androidTests/connected/screenshots
|
path: androidApp/build/reports/androidTests/connected/screenshots
|
||||||
@ -52,12 +65,14 @@ jobs:
|
|||||||
overwrite: true
|
overwrite: true
|
||||||
include-hidden-files: true
|
include-hidden-files: true
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
|
if: steps.check-android-changes.outputs.any_modified == 'true'
|
||||||
with:
|
with:
|
||||||
path: androidApp/build/reports/androidTests/connected/debug/flavors/githubConfig
|
path: androidApp/build/reports/androidTests/connected/debug/flavors/githubConfig
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
overwrite: true
|
overwrite: true
|
||||||
include-hidden-files: true
|
include-hidden-files: true
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
|
if: steps.check-android-changes.outputs.any_modified == 'true'
|
||||||
with:
|
with:
|
||||||
name: coverage-espresso
|
name: coverage-espresso
|
||||||
path: androidApp/build/reports/jacoco/JacocoDebugCodeCoverage
|
path: androidApp/build/reports/jacoco/JacocoDebugCodeCoverage
|
||||||
@ -65,6 +80,6 @@ jobs:
|
|||||||
overwrite: true
|
overwrite: true
|
||||||
include-hidden-files: true
|
include-hidden-files: true
|
||||||
- name: Clean
|
- name: Clean
|
||||||
if: always()
|
if: steps.check-android-changes.outputs.any_modified == 'true' || failure()
|
||||||
run: |
|
run: |
|
||||||
docker compose -f .gitea/workflows/assets/docker-compose.yml stop
|
docker compose -f .gitea/workflows/assets/docker-compose.yml stop
|
@ -87,3 +87,6 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
needs: Lint
|
needs: Lint
|
||||||
uses: ./.gitea/workflows/on_called_build.yml
|
uses: ./.gitea/workflows/on_called_build.yml
|
||||||
|
test:
|
||||||
|
needs: build
|
||||||
|
uses: ./.gitea/workflows/on_called_to_test.yml
|
||||||
|
Loading…
x
Reference in New Issue
Block a user