Skip to content

Commit c2b4fc0

Browse files
author
Akash Satheesan
committed
chore(ci): start caching vscode builds
1 parent 2afcbe6 commit c2b4fc0

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

.github/workflows/ci.yaml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
uses: actions/cache@v2
3636
with:
3737
path: "**/node_modules"
38-
key: ${{ runner.os }}-amd64-${{ hashFiles('**/yarn.lock') }}
38+
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
3939

4040
- name: Install dependencies
4141
if: steps.cache-yarn.outputs.cache-hit != 'true'
@@ -70,7 +70,7 @@ jobs:
7070
uses: actions/cache@v2
7171
with:
7272
path: "**/node_modules"
73-
key: ${{ runner.os }}-amd64-${{ hashFiles('**/yarn.lock') }}
73+
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
7474

7575
- name: Install dependencies
7676
if: steps.cache-yarn.outputs.cache-hit != 'true'
@@ -79,9 +79,26 @@ jobs:
7979
- name: Build code-server
8080
run: yarn build
8181

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+
8299
- name: Build vscode
100+
if: steps.cache-vscode.outputs.cache-hit != 'true'
83101
run: yarn build:vscode
84-
if: success()
85102

86103
# The release package does not contain any native modules
87104
# and is neutral to architecture/os/libc version.
@@ -109,7 +126,8 @@ jobs:
109126
# update EOL of 2024. We're dropping our full support 3 quarters
110127
# early, but this gets us CI speed benefits on GH.
111128

112-
# TODO: cache building here
129+
# TODO: cache building yarn --production
130+
# this requires refactoring our release scripts
113131
runs-on: ubuntu-16.04
114132
steps:
115133
- uses: actions/checkout@v2
@@ -122,7 +140,7 @@ jobs:
122140
- name: Install nfpm
123141
run: |
124142
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
126144
127145
- name: Download npm package
128146
uses: actions/download-artifact@v2

0 commit comments

Comments
 (0)