forked from quarck/CalendarNotification
-
Notifications
You must be signed in to change notification settings - Fork 1
146 lines (129 loc) · 4.48 KB
/
cache-warming.yml
File metadata and controls
146 lines (129 loc) · 4.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Workflow to keep caches warm for faster CI runs
# Runs on schedule and when dependency files change on master
name: Cache Warming
on:
schedule:
# Run daily at 9 AM UTC (4 AM EST, before most development activity)
- cron: '0 9 * * *'
push:
branches: [master]
paths:
# Trigger when dependency files change
- 'yarn.lock'
- 'package.json'
- '**/build.gradle'
- '**/build.gradle.kts'
- '**/gradle-wrapper.properties'
- '**/gradle.properties'
workflow_dispatch:
# Allow manual triggering to refresh caches
env:
# Reuse settings from main workflow
GRADLE_OPTS: "-Dorg.gradle.daemon=true -Dorg.gradle.workers.max=4 -Dorg.gradle.parallel=true -Dorg.gradle.caching=true"
# ccache settings must match main workflow for cache hits
CCACHE_DEBUG: 1
CCACHE_VERBOSE: 1
CCACHE_MAXSIZE: 5G
CCACHE_BASEDIR: ${{ github.workspace }}
jobs:
warm-build-caches:
name: Warm Build Caches (${{ matrix.arch }})
runs-on: ubuntu-latest
strategy:
matrix:
arch: [arm64-v8a, x86_64]
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
# ccache for native compilation - critical for fast builds
# This creates a cache entry on master that PR branches can restore from
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
create-symlink: true
- name: Common Setup
uses: ./.github/actions/common-setup
with:
gradle_max_workers: "4"
node_version: "22.x"
arch: ${{ matrix.arch }}
# Build debug, release, and test APKs to fully populate ccache
# Regular builds compile ~596 native files (debug + release + test)
# This is slower but makes PR builds much faster
- name: Warm Gradle and Native Caches
run: |
cd android && \
./gradlew -PBUILD_ARCH="${{ matrix.arch }}" \
-PreactNativeArchitectures="${{ matrix.arch }}" \
:app:assemble${{ matrix.arch == 'arm64-v8a' && 'Arm64V8a' || 'X8664' }}Debug \
:app:assemble${{ matrix.arch == 'arm64-v8a' && 'Arm64V8a' || 'X8664' }}Release \
:app:assemble${{ matrix.arch == 'arm64-v8a' && 'Arm64V8a' || 'X8664' }}DebugAndroidTest \
--parallel --max-workers=4 --build-cache
env:
BUILD_ARCH: ${{ matrix.arch }}
# Save caches (common-setup uses cache/restore, we need explicit save)
- name: Save Caches
uses: ./.github/actions/cache-update
with:
arch: ${{ matrix.arch }}
warm-test-caches:
name: Warm Test Caches
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Common Setup
uses: ./.github/actions/common-setup
with:
optional_cache_key: "unit-tests"
gradle_max_workers: "4"
node_version: "22.x"
arch: x86_64
# Warm up unit test related caches
# Use architecture-specific task (X8664 for x86_64)
- name: Warm Unit Test Caches
run: |
cd android && \
./gradlew -PBUILD_ARCH="x86_64" \
-PreactNativeArchitectures="x86_64" \
:app:dependencies \
:app:compileX8664DebugUnitTestKotlin \
--parallel --max-workers=4 --build-cache \
-Pandroid.externalNativeBuild.skip=true
env:
BUILD_ARCH: x86_64
- name: Save Caches
uses: ./.github/actions/cache-update
with:
arch: x86_64
optional_cache_key: "unit-tests"
warm-integration-test-caches:
name: Warm Integration Test Caches
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Common Setup
uses: ./.github/actions/common-setup
with:
optional_cache_key: "integration-test"
gradle_max_workers: "4"
node_version: "22.x"
arch: x86_64
android_api_level: "34"
android_target: "google_apis"
android_profile: "Nexus 5X"
run_emulator_setup: "true"
skip_codegen: "true"
- name: Save Caches
uses: ./.github/actions/cache-update
with:
arch: x86_64
optional_cache_key: "integration-test"
run_emulator_setup: "true"
android_api_level: "34"
android_target: "google_apis"