Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/actions/cache-gradle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ inputs:
description: Paths to cache
required: false
default: |
~/.gradle/caches
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
~/.gradle/wrapper
cache-version:
description: Additional cache version segment
Expand Down
23 changes: 23 additions & 0 deletions .github/actions/cleanup-gradle-artifacts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Clean Up Gradle Artifacts

description: Clean up unnecessary Gradle build artifacts to save disk space and reduce cache size.

runs:
using: "composite"
steps:
- name: Clean up Gradle build artifacts
shell: bash
run: |
echo "Cleaning up unnecessary build artifacts to save disk space..."
# Remove build outputs (APK/AAB already tested, no need to cache them)
# Find all Android build directories and clean up intermediates and tmp
find . -type d -path "*/android/app/build/intermediates" -exec rm -rf {} + 2>/dev/null || true
find . -type d -path "*/android/app/build/tmp" -exec rm -rf {} + 2>/dev/null || true
# Clean up Gradle daemon logs and lock files
rm -rf ~/.gradle/daemon
rm -rf ~/.gradle/*.lock
# Remove large cache files that aren't needed for subsequent builds
find ~/.gradle/caches -name "*.lock" -delete 2>/dev/null || true
find ~/.gradle/caches -type f -name "gc.properties" -delete 2>/dev/null || true
echo "Disk usage after cleanup:"
df -h
20 changes: 20 additions & 0 deletions .github/actions/free-disk-space/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Free Disk Space

description: Free up disk space on GitHub Actions runners by removing unnecessary pre-installed tools.

runs:
using: "composite"
steps:
- name: Free up disk space
shell: bash
run: |
echo "Disk usage before cleanup:"
df -h
# Remove unnecessary pre-installed tools to free up space
# These are commonly available on GitHub runners but not needed for most builds
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
echo "Disk usage after cleanup:"
df -h
4 changes: 4 additions & 0 deletions .github/workflows/mobile-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@ jobs:
node_modules
app/node_modules
cache-version: ${{ env.GH_CACHE_VERSION }}-${{ env.NODE_VERSION_SANITIZED }}
- name: Free up disk space
uses: ./.github/actions/free-disk-space
- name: Cache Gradle
uses: ./.github/actions/cache-gradle
with:
Expand Down Expand Up @@ -459,3 +461,5 @@ jobs:
- name: Build Android (with AAPT2 symlink fix)
run: yarn android:ci
working-directory: ./app
- name: Clean up Gradle build artifacts
uses: ./.github/actions/cleanup-gradle-artifacts
6 changes: 6 additions & 0 deletions .github/workflows/mobile-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,8 @@ jobs:
project_id: "plucky-tempo-454713-r0"
workload_identity_provider: "projects/852920390127/locations/global/workloadIdentityPools/gh-self/providers/github-by-repos"
service_account: "[email protected]"
- name: Free up disk space
uses: ./.github/actions/free-disk-space
# Fail fast: set up JDK for keytool and verify Android secrets early
- name: Setup Java environment
if: inputs.platform != 'ios'
Expand Down Expand Up @@ -1178,6 +1180,10 @@ jobs:

echo "✅ Android build output verification passed"

- name: Clean up Gradle build artifacts
if: inputs.platform != 'ios'
uses: ./.github/actions/cleanup-gradle-artifacts

- name: Upload to Google Play Store using WIF
if: inputs.platform != 'ios' && inputs.test_mode != true
timeout-minutes: 10
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/mobile-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ jobs:
- name: Add Maestro to path
if: false # Skip for build-only test - keep logic for future E2E
run: echo "$HOME/.maestro/bin" >> "$GITHUB_PATH"
- name: Free up disk space
uses: ./.github/actions/free-disk-space
- name: Setup Java environment
uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -121,6 +123,8 @@ jobs:
chmod +x app/android/gradlew
(cd app/android && ./gradlew assembleDebug --quiet --parallel --build-cache --no-configuration-cache) || { echo "❌ Android build failed"; exit 1; }
echo "✅ Android build succeeded"
- name: Clean up Gradle build artifacts
uses: ./.github/actions/cleanup-gradle-artifacts
- name: Verify APK and android-passport-nfc-reader integration
run: |
echo "🔍 Verifying build artifacts..."
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/mobile-sdk-demo-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ jobs:
- name: Add Maestro to path
if: false # Skip for build-only test - keep logic for future E2E
run: echo "$HOME/.maestro/bin" >> "$GITHUB_PATH"
- name: Free up disk space
uses: ./.github/actions/free-disk-space
- name: Setup Java environment
uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -124,6 +126,8 @@ jobs:
chmod +x packages/mobile-sdk-demo/android/gradlew
(cd packages/mobile-sdk-demo/android && ./gradlew assembleDebug --quiet --parallel --build-cache --no-configuration-cache) || { echo "❌ Android build failed"; exit 1; }
echo "✅ Android build succeeded"
- name: Clean up Gradle build artifacts
uses: ./.github/actions/cleanup-gradle-artifacts
- name: Verify APK build
run: |
echo "🔍 Verifying build artifacts..."
Expand Down
Loading