From c0dc376dc3af75cd4ec2765832c2b7e50aae811f Mon Sep 17 00:00:00 2001 From: Adam Ward Date: Fri, 2 May 2025 14:47:34 -0400 Subject: [PATCH 1/2] Turn on macOS gh actions --- .github/workflows/pull_request.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index e69f3360d..13e2e7344 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -70,6 +70,16 @@ jobs: windows_pre_build_command: . .github\workflows\scripts\windows\setup.ps1 windows_build_command: scripts\test_windows.ps1 enable_windows_docker: false + # macOS + enable_macos_checks: true + macos_env_vars: | + NODE_VERSION=v20.18.2 + NODE_PATH=/usr/local/nvm/versions/node/v20.18.2/bin + NVM_DIR=/usr/local/nvm + CI=1 + FAST_TEST_RUN=${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && '0' || '1'}} + macos_pre_build_command: . .github/workflows/scripts/setup-linux.sh + macos_build_command: ./scripts/test.sh soundness: name: Soundness From dcc13cb1e67f37ea16b07cd8a8883f1abb6c28c6 Mon Sep 17 00:00:00 2001 From: Adam Ward Date: Thu, 7 Aug 2025 12:42:13 -0400 Subject: [PATCH 2/2] macOS script --- .github/workflows/pull_request.yml | 7 ++---- .github/workflows/scripts/setup-macos.sh | 31 ++++++++++++++++++++++++ .vscode-test.js | 4 +-- scripts/test_macos.sh | 30 +++++++++++++++++++++++ 4 files changed, 65 insertions(+), 7 deletions(-) create mode 100755 .github/workflows/scripts/setup-macos.sh create mode 100755 scripts/test_macos.sh diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 13e2e7344..36edd1932 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -73,13 +73,10 @@ jobs: # macOS enable_macos_checks: true macos_env_vars: | - NODE_VERSION=v20.18.2 - NODE_PATH=/usr/local/nvm/versions/node/v20.18.2/bin - NVM_DIR=/usr/local/nvm CI=1 FAST_TEST_RUN=${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && '0' || '1'}} - macos_pre_build_command: . .github/workflows/scripts/setup-linux.sh - macos_build_command: ./scripts/test.sh + macos_pre_build_command: . .github/workflows/scripts/setup-macos.sh + macos_build_command: ./scripts/test_macos.sh soundness: name: Soundness diff --git a/.github/workflows/scripts/setup-macos.sh b/.github/workflows/scripts/setup-macos.sh new file mode 100755 index 000000000..dbc77c1f7 --- /dev/null +++ b/.github/workflows/scripts/setup-macos.sh @@ -0,0 +1,31 @@ +#!/bin/bash +##===----------------------------------------------------------------------===## +## +## This source file is part of the VS Code Swift open source project +## +## Copyright (c) 2025 the VS Code Swift project authors +## Licensed under Apache License v2.0 +## +## See LICENSE.txt for license information +## See CONTRIBUTORS.txt for the list of VS Code Swift project authors +## +## SPDX-License-Identifier: Apache-2.0 +## +##===----------------------------------------------------------------------===## + +export NODE_VERSION=v20.19.0 +export NVM_DIR="$RUNNER_TEMP/.nvm" +export NODE_PATH="$NVM_DIR/versions/node/v20.19.0/bin" + +mkdir -p "$NVM_DIR" +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash +# shellcheck disable=SC1091 +. "$NVM_DIR/nvm.sh" && nvm install $NODE_VERSION +echo "$NODE_PATH" >> "$GITHUB_PATH" + +env | sort + +if [ -n "$VSCODE_SWIFT_VSIX_ID" ]; then + npm ci --ignore-scripts + npx tsx scripts/download_vsix.ts +fi diff --git a/.vscode-test.js b/.vscode-test.js index f2563a2e0..533b5169e 100644 --- a/.vscode-test.js +++ b/.vscode-test.js @@ -37,8 +37,8 @@ if (dataDir) { launchArgs.push("--user-data-dir", dataDir); } // GPU hardware acceleration not working on Darwin for intel -if (process.platform === "darwin" && process.arch === "x64") { - launchArgs.push("--disable-gpu"); +if (process.platform === "darwin") { + launchArgs.push("--disable-gpu", "--no-sandbox"); } const installExtensions = []; diff --git a/scripts/test_macos.sh b/scripts/test_macos.sh new file mode 100755 index 000000000..ace4cc650 --- /dev/null +++ b/scripts/test_macos.sh @@ -0,0 +1,30 @@ +#!/bin/bash +##===----------------------------------------------------------------------===## +## +## This source file is part of the VS Code Swift open source project +## +## Copyright (c) 2025 the VS Code Swift project authors +## Licensed under Apache License v2.0 +## +## See LICENSE.txt for license information +## See CONTRIBUTORS.txt for the list of VS Code Swift project authors +## +## SPDX-License-Identifier: Apache-2.0 +## +##===----------------------------------------------------------------------===## + +set -ex + +export NODE_OPTIONS="--dns-result-order=ipv4first" +export npm_config_http_proxy="$HTTP_PROXY" +export npm_config_https_proxy="$HTTPS_PROXY" +export VSCODE_DATA_DIR="$RUNNER_TEMP/ud" + +automationmodetool + +npm ci -ignore-script node-pty +npm run lint +npm run format +npm run coverage + +exit "$?"