refactor(ci): Improves CI build performance with enhanced caching (#923)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Gauvain
2025-08-13 15:43:22 +02:00
committed by GitHub
parent 57bbb59874
commit c7f0c2ec83
3 changed files with 75 additions and 19 deletions

View File

@@ -28,9 +28,9 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with: with:
ref: ${{ github.event.pull_request.head.sha || github.sha }} ref: ${{ github.event.pull_request.head.sha || github.sha }}
show-progress: false
submodules: recursive
fetch-depth: 0 fetch-depth: 0
submodules: recursive
show-progress: false
- name: 🍞 Setup Bun - name: 🍞 Setup Bun
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
@@ -41,22 +41,41 @@ jobs:
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with: with:
path: ~/.bun/install/cache path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-cache-${{ hashFiles('bun.lock') }} key: ${{ runner.os }}-${{ runner.arch }}-bun-develop-${{ hashFiles('bun.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-bun-cache- ${{ runner.os }}-${{ runner.arch }}-bun-develop-
${{ runner.os }}-bun-develop-
- name: 💾 Cache node_modules
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: node_modules
key: ${{ runner.os }}-${{ runner.arch }}-modules-latest-develop-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-modules-latest-develop-
${{ runner.os }}-${{ runner.arch }}-modules-develop-
${{ runner.os }}-modules-develop-
- name: 💾 Cache Expo CLI
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: ~/.expo
key: ${{ runner.os }}-expo-cli-develop
restore-keys: ${{ runner.os }}-expo-cli-develop
- name: 📦 Install dependencies and reload submodules - name: 📦 Install dependencies and reload submodules
run: | run: |
bun install --frozen-lockfile bun install --frozen-lockfile
bun run submodule-reload bun run submodule-reload
- name: 💾 Cache Android dependencies - name: 💾 Cache Gradle global
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with: with:
path: android/.gradle path: |
key: ${{ runner.os }}-android-deps-${{ hashFiles('android/**/build.gradle', 'android/gradle/wrapper/gradle-wrapper.properties') }} ~/.gradle/caches
restore-keys: | ~/.gradle/wrapper
${{ runner.os }}-android-deps- key: ${{ runner.os }}-gradle-develop-${{ hashFiles('android/**/build.gradle', 'android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-develop-
- name: 🛠️ Generate project files - name: 🛠️ Generate project files
run: | run: |
@@ -66,6 +85,13 @@ jobs:
bun run prebuild bun run prebuild
fi fi
- name: 💾 Cache project Gradle (.gradle)
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: android/.gradle
key: ${{ runner.os }}-android-gradle-develop-${{ hashFiles('android/**/build.gradle', 'android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-android-gradle-develop-
- name: 🚀 Build APK - name: 🚀 Build APK
env: env:
EXPO_TV: ${{ matrix.target == 'tv' && 1 || 0 }} EXPO_TV: ${{ matrix.target == 'tv' && 1 || 0 }}
@@ -82,4 +108,3 @@ jobs:
android/app/build/outputs/apk/release/*.apk android/app/build/outputs/apk/release/*.apk
android/app/build/outputs/bundle/release/*.aab android/app/build/outputs/bundle/release/*.aab
retention-days: 7 retention-days: 7

View File

@@ -29,9 +29,9 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with: with:
ref: ${{ github.event.pull_request.head.sha || github.sha }} ref: ${{ github.event.pull_request.head.sha || github.sha }}
show-progress: false
submodules: recursive
fetch-depth: 0 fetch-depth: 0
submodules: recursive
show-progress: false
- name: 🍞 Setup Bun - name: 🍞 Setup Bun
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
@@ -42,16 +42,34 @@ jobs:
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with: with:
path: ~/.bun/install/cache path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-cache-${{ hashFiles('bun.lock') }} key: ${{ runner.os }}-${{ runner.arch }}-bun-develop-${{ hashFiles('bun.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-bun-cache- ${{ runner.os }}-${{ runner.arch }}-bun-develop-
${{ runner.os }}-bun-develop-
- name: 💾 Cache node_modules
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: node_modules
key: ${{ runner.os }}-${{ runner.arch }}-modules-latest-develop-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-modules-latest-develop-
${{ runner.os }}-${{ runner.arch }}-modules-develop-
${{ runner.os }}-modules-develop-
- name: 💾 Cache Expo CLI
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: ~/.expo
key: ${{ runner.os }}-expo-cli-develop
restore-keys: ${{ runner.os }}-expo-cli-develop
- name: 📦 Install dependencies and reload submodules - name: 📦 Install dependencies and reload submodules
run: | run: |
bun install --frozen-lockfile bun install --frozen-lockfile
bun run submodule-reload bun run submodule-reload
- name: 🛠️ Generate project files - name: 🛠️ Generate project files (expo prebuild)
run: | run: |
if [ "${{ matrix.target }}" = "tv" ]; then if [ "${{ matrix.target }}" = "tv" ]; then
bun run prebuild:tv bun run prebuild:tv
@@ -59,13 +77,20 @@ jobs:
bun run prebuild bun run prebuild
fi fi
- name: 🏗 Setup EAS - name: 💾 Cache CocoaPods
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: ios/Pods
key: ${{ runner.os }}-pods-develop-${{ hashFiles('ios/Podfile.lock') }}
restore-keys: ${{ runner.os }}-pods-develop-
- name: 🏗️ Setup EAS
uses: expo/expo-github-action@main uses: expo/expo-github-action@main
with: with:
eas-version: 16.17.4 eas-version: 16.17.4
token: ${{ secrets.EXPO_TOKEN }} token: ${{ secrets.EXPO_TOKEN }}
- name: 🏗️ Build iOS app - name: 🚀 Build iOS app
env: env:
EXPO_TV: ${{ matrix.target == 'tv' && 1 || 0 }} EXPO_TV: ${{ matrix.target == 'tv' && 1 || 0 }}
run: eas build -p ios --local --non-interactive run: eas build -p ios --local --non-interactive
@@ -79,4 +104,3 @@ jobs:
name: streamyfin-ios-${{ matrix.target }}-ipa-${{ env.DATE_TAG }} name: streamyfin-ios-${{ matrix.target }}-ipa-${{ env.DATE_TAG }}
path: build-*.ipa path: build-*.ipa
retention-days: 7 retention-days: 7

View File

@@ -26,6 +26,13 @@ module.exports = function withCustomPlugin(config) {
// Expo 52 is not setting this // Expo 52 is not setting this
// https://github.com/expo/expo/issues/32558 // https://github.com/expo/expo/issues/32558
config = setGradlePropertiesValue(config, "android.enableJetifier", "true"); config = setGradlePropertiesValue(config, "android.enableJetifier", "true");
config = setGradlePropertiesValue(config, "org.gradle.daemon", "true");
config = setGradlePropertiesValue(config, "org.gradle.parallel", "true");
config = setGradlePropertiesValue(
config,
"org.gradle.configureondemand",
"true",
);
// Increase memory // Increase memory
config = setGradlePropertiesValue( config = setGradlePropertiesValue(