- luxe update and /update update Luxe with the command for however it was installed (cargo or Homebrew), run one program at a time with the terminal attached, then check that the luxe on PATH is the new version. Luxe never downloads or replaces its own binary. The start screen says "Update available · /update". - A question's typed answer edits at its caret: arrows, word jumps, Home, End and Delete work, and up and down move through a wrapped answer before leaving it. - The version check owes a bump once per release: the version on main is the next release, and only a released one (a v-tag) has to move. - Dependency updates arrive through the sync, so Dependabot and the weekly jobs no longer run here.
57 lines
2.2 KiB
Python
Executable File
57 lines
2.2 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""ci-changes — whether a pull request touched anything CI has to build.
|
|
|
|
Pull-request CI always runs so it can be a required check; a required check that never starts
|
|
blocks the merge for good. This decides whether the jobs have work: prose cannot change what the
|
|
compiler, the suite or the site says, so a prose-only change skips them and reports a pass.
|
|
|
|
Prose is only what is provably not an input: Markdown, `docs/`, `.pi/`, the licenses and
|
|
Dependabot's schedule, except that nothing under `crates/` counts (`luxe-cli` compiles its bundled
|
|
`guide.md` in) and neither does `docs/guide/`, which the suite checks against the code and the site
|
|
renders.
|
|
|
|
Usage: scripts/ci-changes.py [base-sha] prints `code=true|false` for $GITHUB_OUTPUT.
|
|
|
|
When there is nothing to diff against, the jobs run: no base (a run by hand), the all-zero base a
|
|
push of a new branch reports, or a base the history no longer holds after a force-push. Skipping
|
|
has to be proven; running never needs to be.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
import subprocess
|
|
import sys
|
|
|
|
PROSE = re.compile(r"\.md$|^docs/|^\.pi/|^LICENSE-|^\.github/dependabot\.yml$")
|
|
INPUTS_AMONG_PROSE = re.compile(r"^crates/|^docs/guide/")
|
|
|
|
|
|
def is_input(path: str) -> bool:
|
|
"""Whether a change to `path` can change what CI reports."""
|
|
return bool(INPUTS_AMONG_PROSE.search(path)) or not PROSE.search(path)
|
|
|
|
|
|
def changed_since(base: str) -> list[str] | None:
|
|
"""The paths changed since HEAD's merge base with `base`, or `None` when that cannot be said."""
|
|
if re.fullmatch(r"0*", base):
|
|
return None
|
|
diff = ["git", "diff", "--name-only", f"{base}...HEAD"]
|
|
result = subprocess.run(diff, capture_output=True, text=True)
|
|
if result.returncode != 0:
|
|
print(f"ci-changes: {' '.join(diff)} failed, so everything runs: {result.stderr.strip()}",
|
|
file=sys.stderr)
|
|
return None
|
|
return result.stdout.split()
|
|
|
|
|
|
def main() -> int:
|
|
changed = changed_since(sys.argv[1] if len(sys.argv) > 1 else "")
|
|
code = changed is None or any(is_input(path) for path in changed)
|
|
print(f"code={str(code).lower()}")
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|