Skip to content

Commit c939a7f

Browse files
committed
Use pre-packaged Code
1 parent 1913e2b commit c939a7f

File tree

3 files changed

+22
-36
lines changed

3 files changed

+22
-36
lines changed

.github/workflows/ci.yaml

+5-9
Original file line numberDiff line numberDiff line change
@@ -145,19 +145,15 @@ jobs:
145145

146146
# We need to rebuild when we have a new version of Code or when any of
147147
# the patches changed. Use VSCODE_CACHE_VERSION to force a rebuild.
148-
- name: Fetch Code build from cache
149-
id: cache-vscode-2
148+
- name: Fetch prebuilt Code package from cache
149+
id: cache-vscode
150150
uses: actions/cache@v2
151151
with:
152-
path: |
153-
lib/vscode/.build
154-
lib/vscode/out-build
155-
lib/vscode/out-vscode-reh-web
156-
lib/vscode/out-vscode-reh-web-min
157-
key: vscode-reh-build-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff') }}
152+
path: lib/vscode-reh-web-*
153+
key: vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff') }}
158154

159155
- name: Build vscode
160-
if: steps.cache-vscode-2.outputs.cache-hit != 'true'
156+
if: steps.cache-vscode.outputs.cache-hit != 'true'
161157
run: yarn build:vscode
162158

163159
# Our code imports code from VS Code's `out` directory meaning VS Code

ci/build/build-release.sh

+6-22
Original file line numberDiff line numberDiff line change
@@ -65,28 +65,7 @@ EOF
6565
}
6666

6767
bundle_vscode() {
68-
mkdir -p "$VSCODE_OUT_PATH"
69-
rsync "$VSCODE_SRC_PATH/out-vscode-reh-web${MINIFY:+-min}/" "$VSCODE_OUT_PATH/out"
70-
71-
rsync "$VSCODE_SRC_PATH/.build/extensions/" "$VSCODE_OUT_PATH/extensions"
72-
if [ "$KEEP_MODULES" = 0 ]; then
73-
rm -Rf "$VSCODE_OUT_PATH/extensions/node_modules"
74-
else
75-
rsync "$VSCODE_SRC_PATH/node_modules/" "$VSCODE_OUT_PATH/node_modules"
76-
fi
77-
rsync "$VSCODE_SRC_PATH/extensions/package.json" "$VSCODE_OUT_PATH/extensions"
78-
rsync "$VSCODE_SRC_PATH/extensions/yarn.lock" "$VSCODE_OUT_PATH/extensions"
79-
rsync "$VSCODE_SRC_PATH/extensions/postinstall.js" "$VSCODE_OUT_PATH/extensions"
80-
81-
mkdir -p "$VSCODE_OUT_PATH/resources/"
82-
rsync "$VSCODE_SRC_PATH/resources/" "$VSCODE_OUT_PATH/resources/"
83-
84-
# TODO: We should look into using VS Code's packaging task (see
85-
# gulpfile.reh.js). For now copy this directory into the right spot (for some
86-
# reason VS Code uses a different path in production).
87-
mkdir -p "$VSCODE_OUT_PATH/bin/helpers"
88-
rsync "$VSCODE_SRC_PATH/resources/server/bin/helpers/" "$VSCODE_OUT_PATH/bin/helpers"
89-
chmod +x "$VSCODE_OUT_PATH/bin/helpers/browser.sh"
68+
rsync ./lib/vscode-reh-web-*/ "$VSCODE_OUT_PATH"
9069

9170
# Add the commit, date, our name, links, and enable telemetry. This just makes
9271
# telemetry available; telemetry can still be disabled by flag or setting.
@@ -135,6 +114,11 @@ EOF
135114

136115
rsync "$VSCODE_SRC_PATH/remote/yarn.lock" "$VSCODE_OUT_PATH/yarn.lock"
137116

117+
if [ "$KEEP_MODULES" = 0 ]; then
118+
rm -Rf "$VSCODE_OUT_PATH/extensions/node_modules"
119+
rm -Rf "$VSCODE_OUT_PATH/node_modules"
120+
fi
121+
138122
pushd "$VSCODE_OUT_PATH"
139123
symlink_asar
140124
popd

ci/dev/test-unit.sh

+11-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@ main() {
1414
# Our code imports from `out` in order to work during development but if you
1515
# have only built for production you will have not have this directory. In
1616
# that case symlink `out` to a production build directory.
17-
local vscode="lib/vscode"
18-
local link="$vscode/out"
19-
local target="out-build"
20-
if [[ ! -e $link ]] && [[ -d $vscode/$target ]]; then
21-
ln -s "$target" "$link"
17+
if [[ ! -e lib/vscode/out ]]; then
18+
pushd lib
19+
local out=(vscode-reh-web-*)
20+
if [[ -d "${out[0]}" ]]; then
21+
ln -s "../${out[0]}/out" ./vscode/out
22+
else
23+
echo "Could not find lib/vscode/out or lib/vscode-reh-web-*"
24+
echo "Code must be built before running unit tests"
25+
exit 1
26+
fi
27+
popd
2228
fi
2329

2430
# We must keep jest in a sub-directory. See ../../test/package.json for more

0 commit comments

Comments
 (0)