35
35
uses : actions/cache@v2
36
36
with :
37
37
path : " **/node_modules"
38
- key : ${{ runner.os }}-amd64 -${{ hashFiles('**/yarn.lock') }}
38
+ key : yarn-build -${{ hashFiles('**/yarn.lock') }}
39
39
40
40
- name : Install dependencies
41
41
if : steps.cache-yarn.outputs.cache-hit != 'true'
70
70
uses : actions/cache@v2
71
71
with :
72
72
path : " **/node_modules"
73
- key : ${{ runner.os }}-amd64 -${{ hashFiles('**/yarn.lock') }}
73
+ key : yarn-build -${{ hashFiles('**/yarn.lock') }}
74
74
75
75
- name : Install dependencies
76
76
if : steps.cache-yarn.outputs.cache-hit != 'true'
79
79
- name : Build code-server
80
80
run : yarn build
81
81
82
+ # Parse the hash of the latest commit inside lib/vscode
83
+ # use this to avoid rebuilding it if nothing changed
84
+ - name : Get latest lib/vscode rev
85
+ id : vscode-rev
86
+ run : echo "::set-output name=rev::$(git log -1 --format='%H' lib/vscode)"
87
+
88
+ - name : Attempt to fetch vscode build from cache
89
+ id : cache-vscode
90
+ uses : actions/cache@v2
91
+ with :
92
+ path : |
93
+ lib/vscode/.build
94
+ lib/vscode/out-build
95
+ lib/vscode/out-vscode
96
+ lib/vscode/out-vscode-min
97
+ key : vscode-build-${{ steps.vscode-rev.outputs.rev }}
98
+
82
99
- name : Build vscode
100
+ if : steps.cache-vscode.outputs.cache-hit != 'true'
83
101
run : yarn build:vscode
84
- if : success()
85
102
86
103
# The release package does not contain any native modules
87
104
# and is neutral to architecture/os/libc version.
@@ -109,7 +126,8 @@ jobs:
109
126
# update EOL of 2024. We're dropping our full support 3 quarters
110
127
# early, but this gets us CI speed benefits on GH.
111
128
112
- # TODO: cache building here
129
+ # TODO: cache building yarn --production
130
+ # this requires refactoring our release scripts
113
131
runs-on : ubuntu-16.04
114
132
steps :
115
133
- uses : actions/checkout@v2
@@ -122,7 +140,7 @@ jobs:
122
140
- name : Install nfpm
123
141
run : |
124
142
curl -sfL https://install.goreleaser.com/github.com/goreleaser/nfpm.sh | sh -s -- -b ~/.local/bin
125
- export PATH= $HOME/.local/bin:$PATH
143
+ echo " $HOME/.local/bin" >> $GITHUB_PATH
126
144
127
145
- name : Download npm package
128
146
uses : actions/download-artifact@v2
0 commit comments