@@ -76,18 +76,23 @@ jobs:
7676 uses : actions/setup-node@v4
7777 with :
7878 node-version : 20
79- # Use npm for caching, not yarn
80- cache : ' npm'
81- cache-dependency-path : ' **/package-lock.json'
8279
83- # Step 4: Apply patches from the 'patches' directory if it exists.
80+ # Step 4: Cache Yarn dependencies to speed up subsequent builds.
81+ - name : Cache Yarn dependencies
82+ uses : actions/cache@v4
83+ with :
84+ path : |
85+ vscode/node_modules
86+ key : ${{ runner.os }}-node20-${{ hashFiles('vscode/package.json', 'vscode/yarn.lock') }}
87+
88+ # Step 5: Apply patches from the 'patches' directory if it exists.
8489 - name : Apply patches (if any)
8590 run : |
8691 if [ -d patches ] && [ "$(ls -A patches)" ]; then
8792 quilt push -a || true
8893 fi
8994
90- # Step 5 : Generate a version string for this specific build.
95+ # Step 6 : Generate a version string for this specific build.
9196 # It's based on the commit SHA to create a unique identifier.
9297 - name : Set Development Version
9398 id : version
@@ -97,32 +102,31 @@ jobs:
97102 echo "VERSION=$VERSION" >> $GITHUB_ENV
98103 echo "Generated version for this build: $VERSION"
99104
100- # Step 6 : The main build process for vscode, now using npm .
105+ # Step 7 : The main build process for vscode.
101106 - name : Build vscode
102107 run : |
103108 cd vscode
104109 export DISABLE_V8_COMPILE_CACHE=1
105110 export UV_THREADPOOL_SIZE=4
111+ npm i -g node-gyp
112+ yarn install --network-concurrency 1
106113
107- # Install dependencies using npm
108- npm install
109-
110- # The logic for temporarily removing and re-adding ripgrep remains
114+ # Remove and re-add ripgrep
111115 VSCODE_RIPGREP_VERSION=$(jq -r '.dependencies."@vscode/ripgrep"' package.json)
112116 mv package.json package.json.orig
113117 jq 'del(.dependencies."@vscode/ripgrep")' package.json.orig > package.json
114118
115119 # Re-run install to remove ripgrep
116- npm install
120+ yarn install
117121
118- # Add ripgrep back using npm
119- npm install --ignore-scripts "@vscode/ripgrep@${VSCODE_RIPGREP_VERSION}"
122+ # Add ripgrep back
123+ yarn add --ignore-scripts "@vscode/ripgrep@${VSCODE_RIPGREP_VERSION}"
120124
121125 ARCH_ALIAS=linux-x64
122- # Run the gulp build task using npx
123- npx gulp vscode-reh-web-${ARCH_ALIAS}-min
126+ # Run the gulp build task
127+ yarn gulp vscode-reh-web-${ARCH_ALIAS}-min
124128
125- # Step 7 : Find the exact path of the original build output directory.
129+ # Step 8 : Find the exact path of the original build output directory.
126130 - name : Find build output
127131 id : find_output
128132 run : |
@@ -134,7 +138,7 @@ jobs:
134138 echo "Build output found at: $BUILD_PATH"
135139 echo "build_path=$BUILD_PATH" >> $GITHUB_OUTPUT
136140
137- # Step 8 : Rename the build output directory to sagemaker-code-editor
141+ # Step 9 : Rename the build output directory to sagemaker-code-editor
138142 - name : Rename build output directory
139143 id : rename_output
140144 run : |
@@ -144,7 +148,7 @@ jobs:
144148 echo "Renamed build output directory to: $PARENT_DIR/sagemaker-code-editor"
145149 echo "build_path=$PARENT_DIR/sagemaker-code-editor" >> $GITHUB_OUTPUT
146150
147- # Step 9 : Create a compressed tarball of the renamed build output.
151+ # Step 10 : Create a compressed tarball of the renamed build output.
148152 - name : Create tarball archive
149153 run : |
150154 TARBALL="sagemaker-code-editor-${{ env.VERSION }}.tar.gz"
@@ -154,11 +158,11 @@ jobs:
154158 echo "Creating '$TARBALL' from '$BUILD_DIR_NAME' in '$PARENT_DIR'"
155159 tar czf $TARBALL -C "$PARENT_DIR" "$BUILD_DIR_NAME"
156160
157- # Step 10 : Upload the tarball as a build artifact.
161+ # Step 11 : Upload the tarball as a build artifact.
158162 - name : Upload build artifact
159163 uses : actions/upload-artifact@v4
160164 with :
161- name : npm -package
165+ name : yarn -package
162166 path : sagemaker-code-editor-${{ env.VERSION }}.tar.gz
163167 # Run end-to-end tests after the build is complete
164168 run-e2e-tests :
0 commit comments