forked from CodeGraphContext/CodeGraphContext
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (71 loc) · 2.38 KB
/
test-plugins.yml
File metadata and controls
84 lines (71 loc) · 2.38 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
name: Plugin Tests
on:
pull_request:
branches: [main]
paths:
- 'plugins/**'
- 'src/codegraphcontext/plugin_registry.py'
- 'tests/unit/plugin/**'
- 'tests/integration/plugin/**'
push:
branches: [main]
paths:
- 'plugins/**'
- 'src/codegraphcontext/plugin_registry.py'
workflow_dispatch:
jobs:
plugin-unit-tests:
name: Plugin unit + integration tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
- name: Install core CGC (no extras) and dev dependencies
run: |
pip install --no-cache-dir packaging pytest pytest-mock
pip install --no-cache-dir -e ".[dev]"
- name: Install stub plugin (editable)
run: pip install --no-cache-dir -e plugins/cgc-plugin-stub
- name: Run plugin unit tests
env:
PYTHONPATH: src
run: pytest tests/unit/plugin/ -v --tb=short
- name: Run plugin integration tests
env:
PYTHONPATH: src
run: pytest tests/integration/plugin/ -v --tb=short
plugin-import-check:
name: Verify plugin packages import cleanly
runs-on: ubuntu-latest
strategy:
matrix:
plugin: [cgc-plugin-stub, cgc-plugin-otel, cgc-plugin-xdebug]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install plugin
run: |
pip install --no-cache-dir typer neo4j packaging || true
pip install --no-cache-dir -e plugins/${{ matrix.plugin }} || true
- name: Check plugin PLUGIN_METADATA
env:
PYTHONPATH: src
run: |
PLUGIN_MOD=$(echo "${{ matrix.plugin }}" | tr '-' '_')
python -c "
import importlib
mod = importlib.import_module('${PLUGIN_MOD}')
meta = getattr(mod, 'PLUGIN_METADATA', None)
assert meta is not None, 'PLUGIN_METADATA missing'
for field in ('name', 'version', 'cgc_version_constraint', 'description'):
assert field in meta, f'PLUGIN_METADATA missing field: {field}'
print(f'✅ ${PLUGIN_MOD} PLUGIN_METADATA OK: {meta[\"name\"]} v{meta[\"version\"]}')
"