mathstuff/.drone.yml
Juan José Gutiérrez de Quevedo Pérez 619b1c394b
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Update .drone.yml configuration
2025-11-25 11:11:42 +01:00

58 lines
No EOL
1.8 KiB
YAML

kind: pipeline
type: docker
name: android-build
steps:
# Step 1: Build Debug APK
- name: build-debug
image: cirrusci/android-sdk:latest
environment:
GRADLE_USER_HOME: .gradle
commands:
- cd MathHomeWorkHelper
- echo "Building Debug APK..."
- chmod +x ./gradlew
- ./gradlew clean assembleDebug
- echo "Debug APK built successfully!"
# Step 2: Build Release APK
- name: build-release
image: cirrusci/android-sdk:latest
environment:
GRADLE_USER_HOME: .gradle
commands:
- cd MathHomeWorkHelper
- echo "Building Release APK..."
- chmod +x ./gradlew
- ./gradlew clean assembleRelease
- echo "Release APK built successfully!"
# Step 3: Run Unit Tests
- name: run-tests
image: cirrusci/android-sdk:latest
environment:
GRADLE_USER_HOME: .gradle
commands:
- cd MathHomeWorkHelper
- echo "Running unit tests..."
- chmod +x ./gradlew
- ./gradlew test
- echo "Tests completed!"
# Step 4: Generate Build Report
- name: build-report
image: cirrusci/android-sdk:latest
commands:
- cd MathHomeWorkHelper
- echo "=== BUILD REPORT ===" > build_report.txt
- echo "Build Date: $(date)" >> build_report.txt
- echo "Branch: $DRONE_BRANCH" >> build_report.txt
- echo "Commit: $DRONE_COMMIT" >> build_report.txt
- echo "Author: $DRONE_COMMIT_AUTHOR" >> build_report.txt
- echo "" >> build_report.txt
- echo "APK Artifacts:" >> build_report.txt
- ls -lh app/build/outputs/apk/debug/ >> build_report.txt 2>/dev/null || echo "Debug APK not found" >> build_report.txt
- ls -lh app/build/outputs/apk/release/ >> build_report.txt 2>/dev/null || echo "Release APK not found" >> build_report.txt
- cat build_report.txt
when:
status: [success, failure]