@@ -13,61 +13,10 @@ jobs:
1313 - uses : actions/checkout@v4
1414 - name : Install esy
1515 run : npm install -g esy
16-
17- - name : Try to restore install cache
18- uses : actions/cache@v2.1.1
19- with :
20- path : ~/.esy/source
21- key : source-${{ hashFiles('**/index.json') }}
22-
23- - name : Install
24- run : esy install
25-
26- - name : Print esy cache
27- uses : actions/github-script@v3.0.0
28- id : print_esy_cache
29- with :
30- script : |
31- const path = require('path')
32- const scriptPath = path.resolve('.github/workflows/print_esy_cache.js')
33- require(scriptPath)(core)
34-
35- - name : Try to restore build cache
36- id : deps-cache
37- uses : actions/cache@v2.1.1
16+ - uses : esy/github-action@d504f1813939f7821ce4c8ed855ddfcf8b390761
3817 with :
39- path : ${{ steps.print_esy_cache.outputs.esy_cache }}
40- key : build-${{ matrix.os }}-${{ hashFiles('**/index.json') }}
41- restore-keys : build-${{ matrix.os }}-
42-
43- # Here we use a low-level command. In real situation you don't have to
44- # but it is useful in CI as it split the log in GitHub UI.
45- # You can see at a glance if it is your projet or your deps that break.
46- #
47- # We also use --release flag to build less.
48- # This allow us to spot syntax/type error more quickly.
49- - name : Build release dependencies
50- if : steps.deps-cache.outputs.cache-hit != 'true'
51- run : esy build-dependencies --release
52-
53- - name : Build project in release
54- run : esy build --release
55-
56- # Now that our core project build let builds others deps
57- - name : Build dependencies
58- if : steps.deps-cache.outputs.cache-hit != 'true'
59- run : esy build-dependencies
60-
61- - name : Build project
62- run : esy build
63-
64- # Here we cleanup if we have a cache fail because we use restore-keys.
65- # restore-keys take the old store even on cache fail.
66- # So, we have deps we don't care anymore. We prune them.
67- - name : Clean global store
68- if : steps.deps-cache.outputs.cache-hit != 'true'
69- run : esy cleanup .
70-
18+ source-cache-key : 20240515-1
19+ cache-key : ${{ hashFiles('esy.lock/index.json') }}-20240515-1
7120 - name : Test
7221 run : esy test
7322
0 commit comments