Skip to content

Commit 870e941

Browse files
committed
macOS script
1 parent c0dc376 commit 870e941

File tree

3 files changed

+65
-5
lines changed

3 files changed

+65
-5
lines changed

.github/workflows/pull_request.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,10 @@ jobs:
7373
# macOS
7474
enable_macos_checks: true
7575
macos_env_vars: |
76-
NODE_VERSION=v20.18.2
77-
NODE_PATH=/usr/local/nvm/versions/node/v20.18.2/bin
78-
NVM_DIR=/usr/local/nvm
7976
CI=1
8077
FAST_TEST_RUN=${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && '0' || '1'}}
81-
macos_pre_build_command: . .github/workflows/scripts/setup-linux.sh
82-
macos_build_command: ./scripts/test.sh
78+
macos_pre_build_command: . .github/workflows/scripts/setup-macos.sh
79+
macos_build_command: ./scripts/test_macos.sh
8380

8481
soundness:
8582
name: Soundness
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
##===----------------------------------------------------------------------===##
3+
##
4+
## This source file is part of the VS Code Swift open source project
5+
##
6+
## Copyright (c) 2025 the VS Code Swift project authors
7+
## Licensed under Apache License v2.0
8+
##
9+
## See LICENSE.txt for license information
10+
## See CONTRIBUTORS.txt for the list of VS Code Swift project authors
11+
##
12+
## SPDX-License-Identifier: Apache-2.0
13+
##
14+
##===----------------------------------------------------------------------===##
15+
16+
export NODE_VERSION=v20.19.0
17+
export NVM_DIR="$RUNNER_TEMP/.nvm"
18+
export NODE_PATH="$NVM_DIR/versions/node/v20.19.0/bin"
19+
20+
mkdir -p "$NVM_DIR"
21+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
22+
# shellcheck disable=SC1091
23+
. "$NVM_DIR/nvm.sh" && nvm install $NODE_VERSION
24+
echo "$NODE_PATH" >> "$GITHUB_PATH"
25+
26+
env | sort
27+
28+
if [ -n "$VSCODE_SWIFT_VSIX_ID" ]; then
29+
npm ci --ignore-scripts
30+
npx tsx scripts/download_vsix.ts
31+
fi

scripts/test_macos.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
##===----------------------------------------------------------------------===##
3+
##
4+
## This source file is part of the VS Code Swift open source project
5+
##
6+
## Copyright (c) 2025 the VS Code Swift project authors
7+
## Licensed under Apache License v2.0
8+
##
9+
## See LICENSE.txt for license information
10+
## See CONTRIBUTORS.txt for the list of VS Code Swift project authors
11+
##
12+
## SPDX-License-Identifier: Apache-2.0
13+
##
14+
##===----------------------------------------------------------------------===##
15+
16+
set -ex
17+
18+
export NODE_OPTIONS="--dns-result-order=ipv4first"
19+
export npm_config_http_proxy="$HTTP_PROXY"
20+
export npm_config_https_proxy="$HTTPS_PROXY"
21+
export VSCODE_DATA_DIR="$RUNNER_TEMP/ud"
22+
23+
su login $USER
24+
automationmodetool enable-automationmode-without-authentications
25+
DevToolsSecurity --enable
26+
27+
npm ci -ignore-script node-pty
28+
npm run lint
29+
npm run format
30+
npm run coverage
31+
32+
exit "$?"

0 commit comments

Comments
 (0)