From b8d6b06ccb4f7387688dffd37db5352de93cb4ca 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 2fe92c5d8..c920c17b0 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: Invoke-Program 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 145cb38501737d168f8e462528ad8123034fd2b5 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 | 33 ++++++++++++++++++++++++ scripts/test_macos.sh | 30 +++++++++++++++++++++ 3 files changed, 65 insertions(+), 5 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 c920c17b0..97e6ac9b1 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..5bad64c80 --- /dev/null +++ b/.github/workflows/scripts/setup-macos.sh @@ -0,0 +1,33 @@ +#!/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 + +automationmodetool \ No newline at end of file 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 "$?"