Skip to content

Commit

Permalink
workflow (flutter): upgrade actions to latest and using ccache for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Aashu-Dubey committed Jun 10, 2024
1 parent b913a23 commit 1b0cb1d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 11 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,24 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Optional security step: Validate whether gradle-wrapper.jar is valid or malicious
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3

# Setup Java environment in order to build the Android app.
- name: Setup Java environment
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
cache: 'gradle'
java-version: '17'

# Setup gradle using official gradle action
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
add-job-summary: 'on-failure'

# Setup the flutter environment.
- name: Setup Flutter environment
Expand All @@ -51,7 +60,7 @@ jobs:

# Upload generated apk to the artifacts.
- name: Save apk file as artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: flutter-actions-test
path: build/app/outputs/flutter-apk/app-release.apk
24 changes: 20 additions & 4 deletions .github/workflows/build-ios-simulator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,23 @@ jobs:
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Setup the flutter environment.
- name: Setup Flutter environment
uses: subosito/flutter-action@v2
with:
cache: true

- uses: hendrikmuhs/[email protected]
name: Xcode Compile Cache
with:
key: ${{ runner.os }}-ccache # makes a unique key w/related restore key internally
create-symlink: true
max-size: 1500M

- name: Restore Pods cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
ios/Pods
Expand All @@ -36,7 +43,16 @@ jobs:
restore-keys: ${{ runner.os }}-pods-

- name: Build iOS ipa
run: flutter build ios --simulator --no-codesign --obfuscate --split-debug-info --config-only
run: |
export CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros
export CCACHE_FILECLONE=true
export CCACHE_DEPEND=true
export CCACHE_INODECACHE=true
export CCACHE_LIMIT_MULTIPLE=0.95
ccache -s
set -o pipefail
flutter build ios --simulator --no-codesign --obfuscate --split-debug-info --config-only
ccache -s
- name: Store build .app file as zip
run: |
Expand All @@ -46,7 +62,7 @@ jobs:
zip -r -y -o output/flutter_github_actions.zip flutter_github_actions.app
- name: Save build file as artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: flutter_github_actions
path: build/ios/iphonesimulator/output
4 changes: 2 additions & 2 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Flutter environment
uses: subosito/flutter-action@v2
Expand All @@ -29,7 +29,7 @@ jobs:
run: flutter build web --base-href /test_github_action_delete/

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/web

0 comments on commit 1b0cb1d

Please sign in to comment.