revert 24aef2604a
All checks were successful
Merge core/template-android-project to this repo / merge-if-needed (push) Successful in 4s
All checks were successful
Merge core/template-android-project to this repo / merge-if-needed (push) Successful in 4s
revert Update .gitea/workflows/workflow.yml
This commit is contained in:
@@ -6,8 +6,30 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
validate-and-test:
|
validate-and-test:
|
||||||
runs-on: generic
|
runs-on: android
|
||||||
steps:
|
steps:
|
||||||
|
- name: Check ANDROID_SERIAL is set
|
||||||
|
run: |
|
||||||
|
if [ -z "$ANDROID_SERIAL" ]; then
|
||||||
|
echo "❌ Ошибка: Переменная окружения ANDROID_SERIAL не установлена."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "✅ Переменная ANDROID_SERIAL установлена: $ANDROID_SERIAL"
|
||||||
|
|
||||||
|
- name: Check ADB device is connected
|
||||||
|
run: |
|
||||||
|
command -v adb >/dev/null 2>&1 || { echo "❌ Ошибка: adb не найден в PATH." >&2; exit 1; }
|
||||||
|
|
||||||
|
connected_devices=$(adb devices | grep -c "$ANDROID_SERIAL.*device$")
|
||||||
|
|
||||||
|
if [ "$connected_devices" -ne 1 ]; then
|
||||||
|
echo "❌ Ошибка: Устройство с серийным номером $ANDROID_SERIAL не подключено или не доступно."
|
||||||
|
echo "Доступные устройства:"
|
||||||
|
adb devices
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "✅ Устройство с серийным номером $ANDROID_SERIAL подключено и готово к использованию."
|
||||||
|
|
||||||
- name: Checkout PR code
|
- name: Checkout PR code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -23,16 +45,38 @@ jobs:
|
|||||||
GITEA_HEAD_REF: ${{ gitea.event.pull_request.head.ref }}
|
GITEA_HEAD_REF: ${{ gitea.event.pull_request.head.ref }}
|
||||||
|
|
||||||
- name: Checkout tests
|
- name: Checkout tests
|
||||||
run: python3 /opt/scripts/copy-tests.py --repo-url "Olympic/NTO-2025-Android-TeamTask-tests" --branch "main" --task-type "spring"
|
run: python3 /opt/scripts/copy-tests.py --repo-url "Olympic/NTO-2025-Android-TeamTask-tests" --branch "main"
|
||||||
|
|
||||||
|
- name: Uninstall APK before tests (Gradle)
|
||||||
|
run: |
|
||||||
|
chmod +x ./gradlew
|
||||||
|
./gradlew uninstallAll
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: mvn test
|
run: |
|
||||||
|
chmod +x ./gradlew
|
||||||
|
./gradlew connectedDebugAndroidTest
|
||||||
|
|
||||||
|
- name: Uninstall APK after tests (Gradle)
|
||||||
|
run: |
|
||||||
|
chmod +x ./gradlew
|
||||||
|
./gradlew uninstallAll
|
||||||
|
if: always()
|
||||||
|
|
||||||
- name: Upload test results
|
- name: Upload test results
|
||||||
uses: christopherHX/gitea-upload-artifact@v4
|
uses: christopherHX/gitea-upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: test-results
|
name: test-results
|
||||||
path: target/surefire-reports
|
path: app/build/outputs/androidTest-results/connected
|
||||||
|
if-no-files-found: ignore
|
||||||
|
retention-days: 30
|
||||||
|
if: always()
|
||||||
|
|
||||||
|
- name: Upload test reports
|
||||||
|
uses: christopherHX/gitea-upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: test-reports
|
||||||
|
path: app/build/reports/androidTests/connected
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
if: always()
|
if: always()
|
||||||
Reference in New Issue
Block a user