-
Notifications
You must be signed in to change notification settings - Fork 3
107 lines (84 loc) · 2.79 KB
/
Copy pathtest-sccache.yml
File metadata and controls
107 lines (84 loc) · 2.79 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
name: Test sccache Action
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-unix:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup sccache
uses: ./actions/sccache
- name: Configure CMake
run: |
cmake -B build -S test \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
- name: Build
run: cmake --build build --config Release
- name: Run tests
run: ./build/hello_world
- name: Show sccache stats (mid-build)
run: sccache --show-stats
# Build again to verify cache hits
- name: Clean build directory
run: rm -rf build
- name: Configure CMake (second build)
run: |
cmake -B build -S test \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
- name: Build (should have cache hits)
run: cmake --build build --config Release
- name: Show sccache stats (post-build)
run: sccache --show-stats
build-windows:
strategy:
fail-fast: false
matrix:
os: [windows-latest, windows-11-arm]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup sccache
uses: ./actions/sccache
- name: Setup MSVC environment
uses: ./actions/msvc-dev-env
- name: Configure CMake
shell: powershell
run: |
cmake -B build -S test -GNinja `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_C_COMPILER_LAUNCHER=sccache `
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
- name: Build
run: cmake --build build --config Release
- name: Run tests
shell: powershell
run: .\build\hello_world
- name: Show sccache stats (mid-build)
run: sccache --show-stats
# Build again to verify cache hits
- name: Clean build directory
shell: powershell
run: Remove-Item -Recurse -Force build
- name: Configure CMake (second build)
shell: powershell
run: |
cmake -B build -S test -GNinja `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_C_COMPILER_LAUNCHER=sccache `
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
- name: Build (should have cache hits)
run: cmake --build build --config Release
- name: Show sccache stats (post-build)
run: sccache --show-stats