35
35
36
36
- name : Restore vcpkg dependency cache
37
37
uses : actions/cache/restore@v4
38
+ id : cacheRestoreVcpkg
38
39
with :
39
40
path : vcpkg_installed
40
41
key : vcpkgCache-${{ runner.os }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }}
45
46
46
47
- name : Save vcpkg dependency cache
47
48
uses : actions/cache/save@v4
49
+ if : steps.cacheRestoreVcpkg.outputs.cache-hit == 'false'
48
50
with :
49
51
path : vcpkg_installed
50
- key : vcpkgCache- ${{ runner.os }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }}
52
+ key : ${{ steps.cacheRestoreVcpkg.outputs.cache-primary-key }}
51
53
52
54
- name : Copy vcpkg cache to NAS2D folder
53
55
run : |
71
73
72
74
- name : Restore NAS2D cache
73
75
uses : actions/cache/restore@v4
76
+ id : cacheRestoreNas2d
74
77
with :
75
78
path : nas2d-core/.build/
76
79
key : nas2dCache-${{ runner.os }}-${{ matrix.platform }}-${{ env.nas2dSha }}
@@ -84,12 +87,14 @@ jobs:
84
87
85
88
- name : Save build cache - NAS2D
86
89
uses : actions/cache/save@v4
90
+ if : steps.cacheRestoreNas2d.outputs.cache-hit == 'false'
87
91
with :
88
92
path : nas2d-core/.build/
89
- key : nas2dCache- ${{ runner.os }}-${{ matrix.platform }}-${{ env.nas2dSha }}
93
+ key : ${{ steps.cacheRestoreNas2d.outputs.cache-primary-key }}
90
94
91
95
- name : Restore incremental build cache
92
96
uses : actions/cache/restore@v4
97
+ id : cacheRestoreOphd
93
98
if : github.ref != format('refs/heads/{0}', github.event.repository.default_branch)
94
99
with :
95
100
path : .build
@@ -134,6 +139,7 @@ jobs:
134
139
135
140
- name : Save incremental build cache - OPHD
136
141
uses : actions/cache/save@v4
142
+ if : steps.cacheRestoreOphd.outcome == 'skipped' || steps.cacheRestoreOphd.outputs.cache-hit == 'false'
137
143
with :
138
144
path : .build
139
145
key : buildCache-${{ runner.os }}-${{ matrix.platform }}-${{ github.sha }}
0 commit comments