-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 2.54 KB
/
ci.yml
File metadata and controls
65 lines (54 loc) · 2.54 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version-file: .python-version
- name: Clone tree-sitter-m as sibling (uv.lock declares ../tree-sitter-m)
# m-cli's distribution model is clone-and-install: pyproject.toml
# declares tree-sitter-m as a path dep at ../tree-sitter-m. CI must
# provide that sibling checkout before `uv sync` will resolve.
run: git clone --depth=1 https://github.com/m-dev-tools/tree-sitter-m ../tree-sitter-m
- name: Clone m-standard as sibling (read at runtime by lint/_keywords.py)
# Not a Python dependency — `m_cli.lint._keywords` reads the
# integrated TSVs (commands / intrinsic-special-variables /
# intrinsic-functions) at import time to build the canonical ↔
# abbreviation mapping used by `m fmt --rules=expand-*` /
# `m lint` engine-aware rules / the LSP. The lookup walks
# ../m-standard, ../../m-standard, and ~/projects/m-standard.
# Without one of those, the fallback path returns synthetic
# records with empty abbreviation fields and every fmt
# expand/compact test fails.
run: git clone --depth=1 https://github.com/m-dev-tools/m-standard ../m-standard
- name: Install dependencies
run: uv sync --frozen --extra dev
- name: Lint
run: uv run ruff check src/ tests/
- name: Type check
run: uv run mypy src/
- name: Test with coverage
run: uv run pytest --cov --cov-report=term-missing
- name: Manifest drift gate (Phase 0 / Track D)
# Regenerates dist/commands.json, dist/lint-rules.json,
# dist/fmt-rules.json from the live argparse / Rule / FmtRule
# registries and asserts the working tree is unchanged. If a
# contributor adds a subcommand or a rule but forgets to
# `make manifest`, this step fails the build. Invokes the
# Makefile directly — its targets call `.venv/bin/m`, which
# `uv sync --frozen` populated above.
run: make check-manifest
- name: docs/ prose-only gate
# Cross-repo guardrail: docs/ holds only human-readable prose.
# Non-prose artifacts (data, examples, scaffolding templates)
# belong under dist/, examples/, templates/, or a top-level
# domain dir. Engine-free find-based check.
run: make check-docs-prose