@@ -88,15 +88,22 @@ jobs:
8888 uses : dlang-community/setup-dlang@763d869b4d67e50c3ccd142108c8bca2da9df166
8989 with :
9090 compiler : ${{ matrix.dc }}
91- - name : Cache dub dependencies
91+ - name : Cache dub packages (safe to share)
9292 uses : actions/cache@v4
9393 with :
9494 path : |
9595 ~/.dub/packages
96+ key : macos-latest-build-dub-${{ hashFiles('**/dub.sdl', '**/dub.json', '**/dub.selections.json') }}
97+ restore-keys : |
98+ macos-latest-build-dub-packages-
99+ - name : Cache dub build cache (compiler-specific)
100+ uses : actions/cache@v4
101+ with :
102+ path : |
96103 ~/Library/Caches/dub
97104 key : ${{ runner.os }}-dub-${{ matrix.dc }}-${{ hashFiles('**/dub.sdl', '**/dub.json', '**/dub.selections.json') }}
98105 restore-keys : |
99- ${{ runner.os }}-dub-${{ matrix.dc }}-
106+ ${{ runner.os }}-dub-cache- ${{ matrix.dc }}-
100107 - name : Build / test
101108 run : |
102109 dub test --arch=$ARCH --build=unittest-cov
@@ -136,15 +143,22 @@ jobs:
136143 - name : Install multi-lib for 32-bit systems
137144 if : matrix.arch == 'x86'
138145 run : sudo apt-get update && sudo apt-get install gcc-multilib
139- - name : Cache dub dependencies
146+ - name : Cache dub packages (safe to share)
140147 uses : actions/cache@v4
141148 with :
142149 path : |
143150 ~/.dub/packages
151+ key : ubuntu-latest-build-dub-${{ hashFiles('**/dub.sdl', '**/dub.json', '**/dub.selections.json') }}
152+ restore-keys : |
153+ ubuntu-latest-build-dub-packages
154+ - name : Cache dub build cache (compiler-specific)
155+ uses : actions/cache@v4
156+ with :
157+ path : |
144158 ~/.cache/dub
145- key : ${{ runner.os }}-dub-${{ matrix.arch }}-${{ matrix.dc }}-${{ hashFiles('**/dub.sdl', '**/dub.json', '**/dub.selections.json') }}
159+ key : ${{ runner.os }}-dub-cache- ${{ matrix.arch }}-${{ matrix.dc }}-${{ hashFiles('**/dub.sdl', '**/dub.json', '**/dub.selections.json') }}
146160 restore-keys : |
147- ${{ runner.os }}-dub-${{ matrix.arch }}-${{ matrix.dc }}-
161+ ${{ runner.os }}-dub-cache- ${{ matrix.arch }}-${{ matrix.dc }}-
148162 - name : Build / test
149163 run : |
150164 dub test --arch=$ARCH --build=unittest-cov
@@ -180,11 +194,18 @@ jobs:
180194 uses : dlang-community/setup-dlang@763d869b4d67e50c3ccd142108c8bca2da9df166
181195 with :
182196 compiler : ${{ matrix.dc }}
183- - name : Cache dub dependencies
197+ - name : Cache dub packages (safe to share)
184198 uses : actions/cache@v4
185199 with :
186200 path : |
187201 ${{ env.APPDATA }}\dub\packages
202+ key : windows-latest-build-dub-${{ hashFiles('**/dub.sdl', '**/dub.json', '**/dub.selections.json') }}
203+ restore-keys : |
204+ windows-latest-build-dub-
205+ - name : Cache dub build cache (compiler-specific)
206+ uses : actions/cache@v4
207+ with :
208+ path : |
188209 ${{ env.LOCALAPPDATA }}\dub
189210 key : ${{ runner.os }}-dub-${{ matrix.dc }}-${{ hashFiles('**/dub.sdl', '**/dub.json', '**/dub.selections.json') }}
190211 restore-keys : |
0 commit comments