Skip to content

chore: move to patches #4997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use pre-packaged Code
  • Loading branch information
code-asher committed Mar 22, 2022
commit 5bc00882b669f3743b0033719ea6ea2d5f125320
14 changes: 5 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,15 @@ jobs:

# We need to rebuild when we have a new version of Code or when any of
# the patches changed. Use VSCODE_CACHE_VERSION to force a rebuild.
- name: Fetch Code build from cache
id: cache-vscode-2
- name: Fetch prebuilt Code package from cache
id: cache-vscode
uses: actions/cache@v3
with:
path: |
lib/vscode/.build
lib/vscode/out-build
lib/vscode/out-vscode-reh-web
lib/vscode/out-vscode-reh-web-min
key: vscode-reh-build-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff') }}
path: lib/vscode-reh-web-*
key: vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff') }}

- name: Build vscode
if: steps.cache-vscode-2.outputs.cache-hit != 'true'
if: steps.cache-vscode.outputs.cache-hit != 'true'
run: yarn build:vscode

# Our code imports code from VS Code's `out` directory meaning VS Code
Expand Down
27 changes: 6 additions & 21 deletions ci/build/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,7 @@ EOF

bundle_vscode() {
mkdir -p "$VSCODE_OUT_PATH"
rsync "$VSCODE_SRC_PATH/out-vscode-reh-web${MINIFY:+-min}/" "$VSCODE_OUT_PATH/out"

rsync "$VSCODE_SRC_PATH/.build/extensions/" "$VSCODE_OUT_PATH/extensions"
if [ "$KEEP_MODULES" = 0 ]; then
rm -Rf "$VSCODE_OUT_PATH/extensions/node_modules"
else
rsync "$VSCODE_SRC_PATH/node_modules/" "$VSCODE_OUT_PATH/node_modules"
fi
rsync "$VSCODE_SRC_PATH/extensions/package.json" "$VSCODE_OUT_PATH/extensions"
rsync "$VSCODE_SRC_PATH/extensions/yarn.lock" "$VSCODE_OUT_PATH/extensions"
rsync "$VSCODE_SRC_PATH/extensions/postinstall.js" "$VSCODE_OUT_PATH/extensions"

mkdir -p "$VSCODE_OUT_PATH/resources/"
rsync "$VSCODE_SRC_PATH/resources/" "$VSCODE_OUT_PATH/resources/"

# TODO: We should look into using VS Code's packaging task (see
# gulpfile.reh.js). For now copy this directory into the right spot (for some
# reason VS Code uses a different path in production).
mkdir -p "$VSCODE_OUT_PATH/bin/helpers"
rsync "$VSCODE_SRC_PATH/resources/server/bin/helpers/" "$VSCODE_OUT_PATH/bin/helpers"
chmod +x "$VSCODE_OUT_PATH/bin/helpers/browser.sh"
rsync ./lib/vscode-reh-web-*/ "$VSCODE_OUT_PATH"

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

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

if [ "$KEEP_MODULES" = 0 ]; then
rm -Rf "$VSCODE_OUT_PATH/extensions/node_modules"
rm -Rf "$VSCODE_OUT_PATH/node_modules"
fi

pushd "$VSCODE_OUT_PATH"
symlink_asar
popd
Expand Down
16 changes: 11 additions & 5 deletions ci/dev/test-unit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@ main() {
# Our code imports from `out` in order to work during development but if you
# have only built for production you will have not have this directory. In
# that case symlink `out` to a production build directory.
local vscode="lib/vscode"
local link="$vscode/out"
local target="out-build"
if [[ ! -e $link ]] && [[ -d $vscode/$target ]]; then
ln -s "$target" "$link"
if [[ ! -e lib/vscode/out ]]; then
pushd lib
local out=(vscode-reh-web-*)
if [[ -d "${out[0]}" ]]; then
ln -s "../${out[0]}/out" ./vscode/out
else
echo "Could not find lib/vscode/out or lib/vscode-reh-web-*"
echo "Code must be built before running unit tests"
exit 1
fi
popd
fi

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