@@ -18,47 +18,47 @@ jobs:
1818 os : [ubuntu-latest, macOS-latest, windows-latest]
1919
2020 steps :
21- - uses : actions/checkout@v1
2221 - name : Use Node.js ${{ matrix.node-version }}
2322 uses : actions/setup-node@v1
2423 with :
2524 node-version : ${{ matrix.node-version }}
25+ - name : Checkout
26+ uses : actions/checkout@v2
27+
2628 - name : Install esy
2729 run : npm i -g esy@0.6.4
28- - name : Get esy store path
29- id : esy_cache_path
30- shell : bash
31- run : |
32- # COMPUTE THE ESY INSTALL CACHE LOCATION AHEAD OF TIME
33- if [ "${{ matrix.os }}" == "windows-latest" ]; then
34- THE_ESY__CACHE_INSTALL_PATH=$HOME/.esy/3_/i
35- THE_ESY__CACHE_INSTALL_PATH=$( cygpath --mixed --absolute "$THE_ESY__CACHE_INSTALL_PATH")
36- else
37- DESIRED_LEN="86"
38- HOME_ESY3="$HOME/.esy/3"
39- HOME_ESY3_LEN=${#HOME_ESY3}
40- NUM_UNDERS=$(echo "$(($DESIRED_LEN-$HOME_ESY3_LEN))")
41- UNDERS=$(printf "%-${NUM_UNDERS}s" "_")
42- UNDERS="${UNDERS// /_}"
43- THE_ESY__CACHE_INSTALL_PATH=${HOME_ESY3}${UNDERS}/i
44- fi
45- echo "THE_ESY__CACHE_INSTALL_PATH: $THE_ESY__CACHE_INSTALL_PATH"
46- echo "##[set-output name=path;]$THE_ESY__CACHE_INSTALL_PATH"
47- - name : Restore esy cache
30+
31+ - name : Restore esy install cache
4832 uses : actions/cache@v1
4933 with :
50- path : ${{ steps.esy_cache_path.outputs.path }}
51- key : v1-esy-${{ matrix.os }}-${{ hashFiles('**/index.json') }}
52- restore-keys : |
53- v1-esy-${{ matrix.os }}-
34+ path : ~/.esy/source
35+ key : source-${{ hashFiles('**/index.json') }}
36+
5437 - name : esy install
5538 run : esy install
39+
40+ - name : Get esy cache folder
41+ id : print_esy_cache
42+ run : node .github/workflows/print_esy_cache.js
43+
44+ - name : Restore esy build cache
45+ uses : actions/cache@v1
46+ with :
47+ path : ${{ steps.print_esy_cache.outputs.esy_cache }}
48+ key : build-${{ matrix.os }}-${{ hashFiles('**/index.json') }}
49+ restore-keys : build-${{ matrix.os }}-
50+
5651 - name : Build
57- run : esy build
52+ run : |
53+ esy build
54+ # Cleanup build cache in case dependencies have changed
55+ esy cleanup .
56+
5857 - name : Test
5958 run : esy test
60- - name : Get esy binary path
61- id : esy_binary_path
59+
60+ - name : Get binary path
61+ id : print_binary_path
6262 shell : bash
6363 run : |
6464 # from https://stackoverflow.com/a/24848739/617787
6868 ESY__BINARY_PATH=${b}${d#$s/}/Extract.exe
6969 echo "ESY__BINARY_PATH: $ESY__BINARY_PATH"
7070 echo "##[set-output name=path;]$ESY__BINARY_PATH"
71+
7172 - name : (only on release) Upload artifacts ${{ matrix.os }}
7273 if : github.event_name != 'pull_request'
73- uses : actions/upload-artifact@master
74+ uses : actions/upload-artifact@v2
7475 with :
7576 name : ${{ matrix.os }}
76- path : ${{ steps.esy_binary_path .outputs.path }}
77+ path : ${{ steps.print_binary_path .outputs.path }}
0 commit comments