Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

jobs:
verify:
runs-on: macos-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Check scripts
run: bash -n install.sh test_install.sh smoke.sh voice
- name: Run contract tests
run: python3 -m unittest -q test_voice_features.py test_daemon_contract.py
- name: Test installer lifecycle
run: ./test_install.sh
- name: Check documentation links
run: |
python3 - <<'PY'
from html.parser import HTMLParser
from pathlib import Path

files = [Path("install.html"), Path("field-guide.html"), Path("build-packet.html"), Path("index.html")]
errors = []

class Document(HTMLParser):
def __init__(self):
super().__init__()
self.refs = []
self.ids = set()

def handle_starttag(self, tag, attrs):
attrs = dict(attrs)
if attrs.get("id"):
self.ids.add(attrs["id"])
for key in ("href", "src"):
if attrs.get(key):
self.refs.append(attrs[key])

for path in files:
page = Document()
page.feed(path.read_text())
for ref in page.refs:
if ref.startswith(("http://", "https://", "data:", "mailto:")):
continue
target, _, fragment = ref.partition("#")
target_path = path.parent / target if target else path
if not target_path.exists():
errors.append(f"{path}: missing {ref}")
elif fragment and target_path.suffix == ".html":
linked = Document()
linked.feed(target_path.read_text())
if fragment not in linked.ids:
errors.append(f"{path}: missing fragment {ref}")

if errors:
raise SystemExit("\n".join(errors))
print("LINKS PASS")
PY
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=field-guide.html">
<link rel="canonical" href="field-guide.html">
<meta http-equiv="refresh" content="0; url=install.html">
<link rel="canonical" href="install.html">
<title>let-there-be-voice</title>
</head>
<body>
<p>Redirecting to the <a href="field-guide.html">field guide</a>.</p>
<p>Redirecting to the <a href="install.html">installation guide</a>.</p>
</body>
</html>
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ esac

check_platform

if ! has uv; then
if ! has uv && [ "${LTBV_SKIP_SYNC:-0}" != "1" ]; then
[ "${LTBV_SKIP_UV_INSTALL:-0}" != "1" ] || fail "uv is missing and automatic installation is disabled."
say "uv not found, installing it from Astral"
curl -LsSf https://astral.sh/uv/install.sh | sh
Expand Down
Loading