File tree Expand file tree Collapse file tree 4 files changed +12
-18
lines changed Expand file tree Collapse file tree 4 files changed +12
-18
lines changed Original file line number Diff line number Diff line change 6262
6363 - uses : actions/cache@v2
6464 with :
65- path : ' ./root-cache '
65+ path : ' ./.action-docker-layer-caching-docker_images '
6666 key : aws-cli-docker-image-sha-${{ github.sha }}-root
67- restore-keys : |
68- aws-cli-docker-image-sha
69- - run : ls ./root-cache
67+ - run : ls ./.action-docker-layer-caching-docker_images
7068
7169 test_restoring :
7270 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ const main = async () => {
77
88 const layerCache = new LayerCache ( repotag )
99 await layerCache . restore ( key )
10+ await layerCache . cleanUp ( )
1011}
1112
1213main ( ) . catch ( e => {
Original file line number Diff line number Diff line change @@ -7,9 +7,6 @@ const main = async () => {
77
88 const layerCache = new LayerCache ( repotag )
99 await layerCache . store ( key )
10- const layercache2 = new LayerCache ( repotag )
11- // layercache2.imagesDir = `docker_images_restore`
12- await layercache2 . restore ( key )
1310}
1411
1512main ( ) . catch ( e => {
Original file line number Diff line number Diff line change @@ -30,12 +30,11 @@ class LayerCache {
3030 async store ( key : string ) {
3131 this . originalKeyToStore = key
3232 await this . saveImageAsUnpacked ( )
33- // await this.separateAllLayerCaches()
33+ await this . separateAllLayerCaches ( )
3434 // Todo: remove await
3535 const storeRoot = await this . storeRoot ( )
36- // const storeLayers = this.storeLayers()
37- // await Promise.all([storeRoot, storeLayers])
38- await this . cleanUp ( )
36+ const storeLayers = this . storeLayers ( )
37+ await Promise . all ( [ storeRoot , storeLayers ] )
3938 }
4039
4140 private async saveImageAsUnpacked ( ) {
@@ -109,14 +108,13 @@ class LayerCache {
109108 return false
110109 }
111110
112- // const hasRestoredAllLayers = await this.restoreLayers()
113- // if (!hasRestoredAllLayers) {
114- // core.info(`Some layer cache could not be found. aborting.`)
115- // return false
116- // }
117- // await this.joinAllLayerCaches()
111+ const hasRestoredAllLayers = await this . restoreLayers ( )
112+ if ( ! hasRestoredAllLayers ) {
113+ core . info ( `Some layer cache could not be found. aborting.` )
114+ return false
115+ }
116+ await this . joinAllLayerCaches ( )
118117 await this . loadImageFromUnpacked ( )
119- await this . cleanUp ( )
120118 return true
121119 }
122120
You can’t perform that action at this time.
0 commit comments