-
Notifications
You must be signed in to change notification settings - Fork 77
88 lines (80 loc) · 3.26 KB
/
Copy pathcache-warmer.yml
File metadata and controls
88 lines (80 loc) · 3.26 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
name: Cache Warmer
# PR-saved Actions caches are scoped to the PR branch — they are NOT shared
# between PRs. Caches saved on the base branch ARE visible to every PR
# targeting it. This workflow runs the shared setup (FVM SDK, pub, build_runner
# outputs) on each develop push so every fresh PR restores warm caches instead
# of paying the full ~10min prefix. Matrix over both arches because the
# analyze_and_test jobs run on x64 (checks) and arm64 (integration), and the
# FVM + build_runner caches are arch-keyed. The Cargo cache is NOT warmed here:
# it only fills during an actual Rust build, which this workflow deliberately
# avoids.
on:
push:
branches:
- develop
# Docs-only merges don't change any cache input — skip the ~2x10min warm.
# Keep in sync with the paths-ignore in analyze_and_test.yml.
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE'
- '.gitignore'
- '.git-blame-ignore-revs'
- '.github/ISSUE_TEMPLATE/**'
permissions:
contents: read
# Only the newest develop push matters for cache freshness.
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
warm:
strategy:
# The two arch legs are fully independent seeds — one arch's transient
# failure must not cancel the other's warm.
fail-fast: false
matrix:
runner: [ubuntu-24.04, ubuntu-24.04-arm]
runs-on: ${{ matrix.runner }}
timeout-minutes: 30
steps:
- name: Checkout Repository
uses: actions/checkout@v7
# x64 stock images are tight on disk once the SDK + pub + build_runner
# output land (see the checks job in analyze_and_test.yml); the arm64
# partner image is leaner and the action is x64-oriented, so clean up
# inline there instead.
- name: Free disk space (x64)
if: ${{ runner.arch == 'X64' }}
# Pinned to a commit SHA (not the mutable v1.3.1 tag): third-party action.
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: false
- name: Free disk space (arm64, inline)
if: ${{ runner.arch == 'ARM64' }}
run: |
sudo rm -rf /usr/local/lib/android /opt/hostedtoolcache /usr/share/dotnet /opt/ghc || true
df -h /
- name: Flutter setup
uses: ./.github/actions/flutter-setup
# The composite only RESTORES the build_runner cache (PR jobs must never
# save — quota); this workflow is the single writer. Keep path + key in
# sync with the restore step in .github/actions/flutter-setup/action.yml.
- name: Save build_runner cache
uses: actions/cache/save@v6
with:
path: |
.dart_tool/build
**/*.g.dart
**/*.freezed.dart
**/*.mocks.dart
**/*.gen.dart
**/*.gr.dart
**/*.config.dart
!packages/bull_ui_catalogue/lib/main.directories.g.dart
key: buildrunner-${{ hashFiles('.github/actions/flutter-setup/action.yml', '.github/workflows/cache-warmer.yml') }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pubspec.lock') }}-${{ github.sha }}