91
91
sudo chmod +x /usr/bin/sccache
92
92
shell : bash
93
93
94
- - name : Cache scoop (on Windows)
95
- uses : actions/cache@v3
94
+ - name : Cache scoop (restore) (on Windows)
95
+ uses : actions/cache/restore@v3
96
+ id : restore-scoop-cache
96
97
if : runner.os == 'Windows'
97
98
with :
98
99
path : ~\scoop
@@ -101,33 +102,18 @@ jobs:
101
102
${{ runner.os }}-scoop-${{ env.OS_VER }}-
102
103
${{ runner.os }}-scoop-
103
104
104
- - name : Cache vcpkg/downloads (on Windows)
105
- uses : actions/cache@v3
105
+ - name : Cache vcpkg/downloads and vcpkg/installed (restore) (on Windows)
106
+ uses : actions/cache/restore@v3
107
+ id : restore-vcpkg-cache
106
108
if : runner.os == 'Windows'
107
109
with :
108
- path : C:\vcpkg\downloads
109
- key : ${{ runner.os }}-vcpkg-download-${{ env.OS_VER }}-${{ hashFiles('.github/workflows/build.yml') }}
110
+ path : |
111
+ C:\vcpkg\downloads
112
+ C:\vcpkg\installed
113
+ key : ${{ runner.os }}-vcpkg-${{ env.OS_VER }}-${{ hashFiles('.github/workflows/build.yml') }}
110
114
restore-keys : |
111
- ${{ runner.os }}-vcpkg-download-${{ env.OS_VER }}-
112
- ${{ runner.os }}-vcpkg-download-
113
- - name : Cache vcpkg/installed (on Windows)
114
- uses : actions/cache@v3
115
- if : runner.os == 'Windows'
116
- with :
117
- path : C:\vcpkg\installed
118
- key : ${{ runner.os }}-vcpkg-installed-${{ matrix.os }}-${{ hashFiles('.github/workflows/build.yml') }}
119
- restore-keys : |
120
- ${{ runner.os }}-vcpkg-installed-${{ matrix.os }}-
121
- ${{ runner.os }}-vcpkg-installed-
122
-
123
- - name : Cache SCCACHE_DIR
124
- uses : actions/cache@v3
125
- with :
126
- path : " ${{ env.SCCACHE_DIR }}"
127
- key : ${{ runner.os }}-sccache-${{ matrix.os }}-${{ github.sha }}
128
- restore-keys : |
129
- ${{ runner.os }}-sccache-${{ matrix.os }}-
130
- ${{ runner.os }}-sccache-
115
+ ${{ runner.os }}-vcpkg-${{ env.OS_VER }}-
116
+ ${{ runner.os }}-vcpkg-
131
117
132
118
- name : Install Windows dependencies
133
119
if : runner.os == 'Windows'
@@ -141,13 +127,35 @@ jobs:
141
127
142
128
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#add-a-system-path-add-path
143
129
Add-Content ${env:GITHUB_PATH} "${HOME}/scoop/shims"
144
-
130
+ shell : pwsh
131
+
132
+ - name : Cache scoop (save) (on Windows)
133
+ uses : actions/cache/save@v3
134
+ if : runner.os == 'Windows'
135
+ with :
136
+ path : ~\scoop
137
+ key : ${{ steps.restore-scoop-cache.outputs.cache-primary-key }}
138
+
139
+ - name : Cache vcpkg/downloads and vcpkg/installed (save) (on Windows)
140
+ uses : actions/cache/save@v3
141
+ if : runner.os == 'Windows'
142
+ with :
143
+ path : |
144
+ C:\vcpkg\downloads
145
+ C:\vcpkg\installed
146
+ key : ${{ steps.restore-vcpkg-cache.outputs.cache-primary-key }}
147
+
148
+ # don't save this into the vcpkg cache
149
+ - name : Copy over Boost DLLs to where we expect them
150
+ if : runner.os == 'Windows'
151
+ run : |
145
152
# work around assumptions in our build scripts about boost libs layout
146
153
Copy-Item -Path C:/vcpkg/installed/x64-windows/debug/bin/* -Include *.dll -Destination C:/vcpkg/installed/x64-windows/debug/lib
147
154
Get-Item C:/vcpkg/installed/x64-windows/debug/lib/*.dll | Rename-Item -NewName { $_.Name -replace '-vc14.-mt-gd-x64-1_81.dll','-vc140-mt-gd.dll' }
148
155
# display results of this hard work
149
156
ls C:/vcpkg/installed/x64-windows/debug/bin/
150
157
ls C:/vcpkg/installed/x64-windows/debug/lib/
158
+
151
159
# now do the same for release
152
160
Copy-Item -Path C:/vcpkg/installed/x64-windows/bin/* -Include *.dll -Destination C:/vcpkg/installed/x64-windows/lib
153
161
Get-Item C:/vcpkg/installed/x64-windows/lib/*.dll | Rename-Item -NewName { $_.Name -replace '-vc14.-mt-x64-1_81.dll','-vc140-mt.dll' }
@@ -156,6 +164,16 @@ jobs:
156
164
ls C:/vcpkg/installed/x64-windows/lib/
157
165
shell : pwsh
158
166
167
+ - name : Cache SCCACHE_DIR (restore)
168
+ uses : actions/cache/restore@v3
169
+ id : restore-sccache-cache
170
+ with :
171
+ path : " ${{ env.SCCACHE_DIR }}"
172
+ key : ${{ runner.os }}-sccache-${{ matrix.os }}-${{ github.sha }}
173
+ restore-keys : |
174
+ ${{ runner.os }}-sccache-${{ matrix.os }}-
175
+ ${{ runner.os }}-sccache-
176
+
159
177
# Windows build should ideally use something like '-G "Visual Studio 16 2019" -A x64',
160
178
# but -DCMAKE_C_COMPILER_LAUNCHER is only supported by make and ninja generators
161
179
# https://devblogs.microsoft.com/scripting/powertip-line-continuation-in-powershell/
@@ -176,6 +194,12 @@ jobs:
176
194
cmake --install "${{env.BuildDir}}" --config ${{env.BuildType}}
177
195
shell : pwsh
178
196
197
+ - name : Cache SCCACHE_DIR (save)
198
+ uses : actions/cache/save@v3
199
+ with :
200
+ path : " ${{ env.SCCACHE_DIR }}"
201
+ key : ${{ steps.restore-sccache-cache.outputs.cache-primary-key }}
202
+
179
203
- id : ctest
180
204
name : ctest
181
205
working-directory : ${{env.BuildDir}}
0 commit comments