-
Notifications
You must be signed in to change notification settings - Fork 2.7k
123 lines (108 loc) · 4.45 KB
/
Copy pathcache-warm.yml
File metadata and controls
123 lines (108 loc) · 4.45 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
# Nightly compiler-cache warming for main's scope. GitHub cache isolation
# lets a PR restore only caches written by its own ref or the base branch —
# and nothing used to write test caches in main's scope (the test workflow
# runs on pull_request and workflow_dispatch only), so the cross-ref
# fallback restore keys in _test.yml had no warm source and every fresh PR
# built cold. This build-only job (no tests) keeps main-scoped caches at
# most a day stale; CCACHE_COMPILERCHECK=content turns staleness into
# partial misses, never wrong output. The build commands and ccache
# environment mirror scripts/test.sh's build phase exactly — a warm entry
# only hits when flags and compiler content match, so fidelity here is what
# makes the cache useful.
name: Cache warm
on:
schedule:
- cron: '17 2 * * *'
workflow_dispatch: {}
permissions:
contents: read
jobs:
warm-unix:
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, cc: gcc, cxx: g++ }
- { os: ubuntu-24.04-arm, cc: gcc, cxx: g++ }
- { os: macos-14, cc: cc, cxx: c++ }
- { os: macos-15-intel, cc: cc, cxx: c++ }
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install deps (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get update && sudo apt-get install -y zlib1g-dev ccache
- name: Install ccache (macOS)
if: startsWith(matrix.os, 'macos')
run: command -v ccache >/dev/null 2>&1 || brew install ccache
- name: Compiler cache (restore)
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ github.workspace }}/.ccache
key: ccache-test-${{ matrix.os }}-${{ matrix.cc }}-${{ github.ref }}-${{ github.sha }}
restore-keys: |
ccache-test-${{ matrix.os }}-${{ matrix.cc }}-${{ github.ref }}-
ccache-test-${{ matrix.os }}-${{ matrix.cc }}-
- name: Build (test runner + product, no tests)
run: |
source scripts/env.sh
make -j"$(getconf _NPROCESSORS_ONLN)" -f Makefile.cbm \
build/c/test-runner cbm CC=${{ matrix.cc }} CXX=${{ matrix.cxx }}
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 1500M
- name: ccache stats
run: ccache -sv || ccache -s
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
- name: Compiler cache (save)
if: always()
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ github.workspace }}/.ccache
key: ccache-test-${{ matrix.os }}-${{ matrix.cc }}-${{ github.ref }}-${{ github.sha }}
warm-windows:
runs-on: windows-latest
timeout-minutes: 90
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2
with:
msystem: CLANG64
path-type: inherit
install: >-
mingw-w64-clang-x86_64-clang
mingw-w64-clang-x86_64-compiler-rt
mingw-w64-clang-x86_64-zlib
mingw-w64-clang-x86_64-ccache
make
git
- name: Compiler cache (restore)
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ github.workspace }}/.ccache
key: ccache-test-windows-latest-CLANG64-${{ github.ref }}-${{ github.sha }}
restore-keys: |
ccache-test-windows-latest-CLANG64-${{ github.ref }}-
ccache-test-windows-latest-CLANG64-
- name: Build (test runner + product, no tests)
run: |
source scripts/env.sh
make -j"$(nproc)" -f Makefile.cbm build/c/test-runner cbm CC=clang CXX=clang++
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 1500M
- name: ccache stats
run: ccache -sv || ccache -s
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
- name: Compiler cache (save)
if: always()
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ github.workspace }}/.ccache
key: ccache-test-windows-latest-CLANG64-${{ github.ref }}-${{ github.sha }}