-
Notifications
You must be signed in to change notification settings - Fork 61
151 lines (133 loc) · 5.07 KB
/
lsp-tests.yml
File metadata and controls
151 lines (133 loc) · 5.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: LSP Tests
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
CI: true
jobs:
lsp-tests:
name: LSP Tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
# Temporarily re-disable Windows - Big Brain's PATHEXT fix didn't fully resolve the issue
# Need to debug why typescript-language-server.cmd still not detected by Rust tests
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
- name: Setup Rust cache
uses: actions/cache@v4
timeout-minutes: 5
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-lsp-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('rust-toolchain', 'rust-toolchain.toml') || 'stable' }}
restore-keys: |
${{ runner.os }}-lsp-cargo-${{ hashFiles('**/Cargo.lock') }}-
${{ runner.os }}-lsp-cargo-
${{ runner.os }}-cargo-
- name: Install Go for LSP tests
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Install gopls
run: go install golang.org/x/tools/gopls@latest
- name: Install Node.js for TypeScript/JavaScript LSP tests
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install TypeScript language server
run: |
npm install -g typescript-language-server typescript
echo "NPM global bin path: $(npm config get prefix)"
- name: Setup PHP for phpactor
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: composer
- name: Install phpactor (PHP language server)
run: |
mkdir -p "$HOME/.local/bin"
curl -fsSL https://github.com/phpactor/phpactor/releases/latest/download/phpactor.phar -o "$HOME/.local/bin/phpactor"
chmod +x "$HOME/.local/bin/phpactor"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Show LSP tool versions
run: |
rustc --version
cargo --version
go version
gopls version
node --version
npm --version
typescript-language-server --version
php --version
composer --version
phpactor --version
- name: Build Rust project
run: cargo build
- name: Build LSP daemon for tests
run: |
cd lsp-daemon
cargo build
- name: Run multi-workspace LSP tests
env:
PROBE_CI: 1
run: |
cd lsp-daemon
cargo test --test integration_multi_workspace
- name: Run LSP integration tests
env:
PROBE_CI: 1
run: cargo test --test lsp_integration_tests
- name: Run comprehensive LSP tests
env:
DEBUG: 1
PROBE_CI: 1
shell: bash
run: |
echo "=== CI Environment Debug Info ==="
echo "CI=$CI"
echo "GITHUB_ACTIONS=$GITHUB_ACTIONS"
echo "RUNNER_OS=$RUNNER_OS"
echo "PATH=$PATH"
echo "=== Ensuring npm global binaries are in PATH ==="
if [ "$RUNNER_OS" = "Windows" ]; then
echo "Windows detected - adding npm global path to system PATH"
NPM_GLOBAL=$(npm config get prefix)
echo "NPM global prefix: $NPM_GLOBAL"
# Convert Windows path format and add to system PATH for test execution
NPM_GLOBAL_UNIX=$(cygpath -u "$NPM_GLOBAL" 2>/dev/null || echo "$NPM_GLOBAL")
export PATH="$NPM_GLOBAL_UNIX:$NPM_GLOBAL:$PATH"
echo "Updated PATH: $PATH"
# Also add to Windows system PATH for the test processes
echo "$NPM_GLOBAL" >> "$GITHUB_PATH"
echo "Added to GITHUB_PATH: $NPM_GLOBAL"
fi
echo "=== Ensuring composer global binaries are in PATH ==="
COMPOSER_BIN=$(composer global config bin-dir --absolute 2>/dev/null || echo "")
if [ -n "$COMPOSER_BIN" ] && [ -d "$COMPOSER_BIN" ]; then
echo "Composer global bin directory: $COMPOSER_BIN"
export PATH="$COMPOSER_BIN:$PATH"
echo "Updated PATH with composer: $PATH"
else
echo "Warning: Could not determine composer global bin directory"
fi
echo "=== Language Server Versions ==="
gopls version || echo "gopls version failed"
typescript-language-server --version || echo "typescript-language-server version failed"
phpactor --version || echo "phpactor version failed"
echo "=== Starting LSP comprehensive tests ==="
echo "NOTE: Running tests sequentially with --test-threads=1 to avoid race conditions"
cargo test --test lsp_comprehensive_tests -- --nocapture --test-threads=1