Adds multiple changes: #97
Workflow file for this run
This file contains hidden or 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: Build Feature Branch Apk | |
| on: [ push, pull_request ] | |
| jobs: | |
| build-job: | |
| runs-on: ubuntu-latest # enables hardware acceleration in the virtual machine | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Copy CI gradle.properties | |
| run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: 17 | |
| - name: Print git commit variables | |
| run: | | |
| echo "TAG: $CURRENT_TAG" | |
| - name: Copy CI gradle.properties | |
| run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
| - name: Build | |
| run: ./gradlew --stacktrace clean assemble | |
| - name: Run Tests | |
| run: ./gradlew --stacktrace test | |
| - name: Display Test Results | |
| if: always() | |
| run: | | |
| echo "Test Results Summary:" | |
| find . -type f -path "*/build/test-results/*/TEST-*.xml" | while read file; do | |
| echo "File: $file" | |
| # Extract test class name | |
| class_name=$(grep 'testcase classname=' "$file" | head -1 | sed 's/.*classname="\([^"]*\)".*/\1/') | |
| echo "Class: $class_name" | |
| # Count total, failures, and errors | |
| total=$(grep -c '<testcase' "$file" || echo 0) | |
| failures=$(grep -c '<failure' "$file" || echo 0) | |
| errors=$(grep -c '<error' "$file" || echo 0) | |
| echo "Total: $total, Failures: $failures, Errors: $errors" | |
| # Print details of failures and errors | |
| if [ $failures -gt 0 ] || [ $errors -gt 0 ]; then | |
| echo "Failed Tests:" | |
| grep -A 3 '<failure\|<error' "$file" | grep -v '^--$' | |
| fi | |
| echo "----------------------------------------" | |
| done | |
| - name: Upload Test Reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-reports | |
| path: | | |
| */build/reports/tests/ | |
| */build/test-results/ |