Skip to content

Commit

Permalink
workflow (ionic): better cache handling for iOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
Aashu-Dubey committed Jun 22, 2024
1 parent 934de95 commit fdde161
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

# Setup Java environment in order to build the Android app.
- name: Setup Java 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/build-ios-simulator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ jobs:
node-version: '20'
cache: 'npm'

- 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 node_modules from cache
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -54,6 +61,13 @@ jobs:
key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }}
restore-keys: ${{ runner.os }}-pods-

- name: Restore build artifacts from cache
uses: actions/cache@v4
with:
path: ios/App/build
key: ${{ runner.os }}-ios-derived-data-${{ hashFiles('ios/Podfile.lock') }}
restore-keys: ${{ runner.os }}-ios-derived-data-

- name: Build the ionic project for iOS
run: ionic capacitor build ios --prod --no-open

Expand Down Expand Up @@ -87,13 +101,21 @@ jobs:
- name: Run simulator build command
working-directory: ios/App
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
xcodebuild \
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
-scheme App \
-workspace App.xcworkspace \
-sdk iphonesimulator \
-configuration Release \
-derivedDataPath build | xcpretty
ccache -s
- name: Store build .app file as zip
working-directory: ios/App
Expand Down

0 comments on commit fdde161

Please sign in to comment.