-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (95 loc) · 3.79 KB
/
Copy pathci.yml
File metadata and controls
111 lines (95 loc) · 3.79 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
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
# ── 7.1+7.2+7.4: Scope-aware static checks (Lua-based; replaces 4 shell-grep jobs) ──
# Covers:
# - dap-isolation: no `dap.listeners` / `dap.session` outside session/
# - event-data: no `<param>.data` reads inside subscribe handler bodies
# where <param> is the event-parameter name
# - blocking-handler: no `vim.fn.system{list}` / `io.read|popen` /
# `vim.wait(>0)` inline inside a subscribe handler body
# See scripts/lint.lua and design D3 (deep call-graph analysis intentionally
# out of scope — these rules catch inline violations only).
lint:
name: "Lint: static checks (scripts/lint.lua)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Neovim (for `nvim -l` lua runner)
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: v0.10.0
- name: Run lint
run: nvim -l scripts/lint.lua lua
# ── 7.3: Unit tests under plenary ─────────────────────────────────────────
unit-tests:
name: "Unit tests (plenary)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Neovim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: v0.10.0
- name: Install plenary.nvim
run: |
mkdir -p ~/.local/share/nvim/lazy
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim \
~/.local/share/nvim/lazy/plenary.nvim
- name: Install nvim-dap
run: |
git clone --depth 1 https://github.com/mfussenegger/nvim-dap \
~/.local/share/nvim/lazy/nvim-dap
- name: Run unit tests
run: |
nvim --headless \
-u tests/minimal_init.lua \
-c "lua require('plenary.test_harness').test_directory('tests/session/', { minimal_init = 'tests/minimal_init.lua', sequential = true })" \
-c "qa!"
# ── 7.5: Smoke test (vscode-js-debug) ─────────────────────────────────────
smoke-test:
name: "Smoke test (vscode-js-debug)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Neovim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: v0.10.0
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install plenary.nvim
run: |
mkdir -p ~/.local/share/nvim/lazy
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim \
~/.local/share/nvim/lazy/plenary.nvim
- name: Install nvim-dap
run: |
git clone --depth 1 https://github.com/mfussenegger/nvim-dap \
~/.local/share/nvim/lazy/nvim-dap
- name: Install vscode-js-debug
run: |
npm install -g @vscode/js-debug
# Locate the installed extension path.
JS_DEBUG_PATH=$(node -e "require.resolve('@vscode/js-debug/src/dapDebugServer')" 2>/dev/null | sed 's|/src/dapDebugServer.*||' || true)
if [ -z "$JS_DEBUG_PATH" ]; then
JS_DEBUG_PATH=$(npm root -g)/@vscode/js-debug
fi
echo "VSCODEJSDEBUG=${JS_DEBUG_PATH}" >> "$GITHUB_ENV"
echo "vscode-js-debug path: ${JS_DEBUG_PATH}"
- name: Run smoke test
env:
CI: "true"
run: |
nvim --headless \
-u tests/minimal_init.lua \
-c "lua require('plenary.test_harness').test_directory('tests/session/', { minimal_init = 'tests/minimal_init.lua', sequential = true, pattern = 'smoke_spec' })" \
-c "qa!"