diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index 847aaab0b..118c78f41 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -91,12 +91,26 @@ jobs: cd core npm ci --legacy-peer-deps - # 3. Run tests for the extension + # 2.5. Pre package and download anything that needs to be built on Apple Silicon - name: Prepare the extension run: | cd extensions/vscode npm run prepackage + - name: Download node_modules for esbuild on Apple Silicon + if: matrix.os == 'macos-latest' && matrix.arch == 'arm64' + run: curl -o extensions/vscode/out/node_modules https://continue-server-binaries.s3.us-west-1.amazonaws.com/node_modules.zip + + - name: Unzip node_modules for esbuild on Apple Silicon + if: matrix.os == 'macos-latest' && matrix.arch == 'arm64' + run: unzip extensions/vscode/out/node_modules + + - name: Remove node_modules.zip for esbuild on Apple Silicon + if: matrix.os == 'macos-latest' && matrix.arch == 'arm64' + run: rm extensions/vscode/out/node_modules.zip + + # 3. Run tests for the extension + # - name: Install Xvfb for Linux and run tests # run: | # sudo apt-get install -y xvfb # Install Xvfb diff --git a/extensions/vscode/esbuild.js b/extensions/vscode/esbuild.js index 7b3f01df0..ada252280 100644 --- a/extensions/vscode/esbuild.js +++ b/extensions/vscode/esbuild.js @@ -18,6 +18,11 @@ const fs = require("fs"); }, }); + // Return instead of copying if on ARM Mac + if (process.platform === "darwin" && process.arch === "arm64") { + return; + } + fs.mkdirSync("out/node_modules", { recursive: true }); ncp.ncp("node_modules/esbuild", "out/node_modules/esbuild", function (err) {