-
Notifications
You must be signed in to change notification settings - Fork 180
optimize github workflow cache space #1273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| 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 |
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
| 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 | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
transphorm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: Setup Java environment | ||
| if: inputs.platform != 'ios' | ||
|
|
@@ -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 | ||
|
|
||
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.