Skip to content
Closed
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
7 changes: 7 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": ["@commitlint/config-conventional"],
"rules": {
"header-max-length": [2, "always", 100],
"body-max-line-length": [1, "always", 100]
}
}
41 changes: 41 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: 2
updates:
# Desktop Go backend (Wails)
- package-ecosystem: gomod
directory: /desktop
schedule:
interval: weekly
open-pull-requests-limit: 5
commit-message:
prefix: chore
include: scope

# Desktop frontend (Vite/TS, pnpm)
- package-ecosystem: npm
directory: /desktop/frontend
schedule:
interval: weekly
open-pull-requests-limit: 5
commit-message:
prefix: chore
include: scope

# Device web UI (Vite/TS, pnpm)
- package-ecosystem: npm
directory: /web
schedule:
interval: weekly
open-pull-requests-limit: 5
commit-message:
prefix: chore
include: scope

# GitHub Actions used by the workflows
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
commit-message:
prefix: ci
include: scope
112 changes: 112 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: CI

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

jobs:
changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
firmware: ${{ steps.filter.outputs.firmware }}
web: ${{ steps.filter.outputs.web }}
desktop: ${{ steps.filter.outputs.desktop }}
steps:
- uses: actions/checkout@v7
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
firmware:
- 'firmware/**'
- 'tools/gen_db_header.py'
- 'material_database.json'
web:
- 'web/**'
- 'tools/build_web.py'
- 'tools/gen_db_header.py'
- 'material_database.json'
desktop:
- 'desktop/**'

firmware:
needs: changes
if: needs.changes.outputs.firmware == 'true'
name: Build firmware (ESP32-C3)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Cache PlatformIO
uses: actions/cache@v6
with:
path: |
~/.platformio
~/.cache/pip
key: pio-${{ runner.os }}-${{ hashFiles('firmware/platformio.ini') }}
- name: Install PlatformIO
run: pip install platformio
- name: Prepare generated + secret files
run: |
python tools/gen_db_header.py
cp firmware/include/secrets.h.example firmware/include/secrets.h
- name: Build
run: pio run -d firmware

web:
needs: changes
if: needs.changes.outputs.web == 'true'
name: Build web assets
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- uses: actions/setup-node@v6
with:
node-version: "22"
- name: Enable pnpm (via corepack)
run: corepack enable
- name: Generate DB header + build/gzip web assets
# build_web.py runs the Vite build (pnpm) then gzips web/dist.
run: |
python tools/gen_db_header.py
python tools/build_web.py

desktop:
needs: changes
if: needs.changes.outputs.desktop == 'true'
name: Build desktop app (Wails)
# Pinned to 22.04 for libwebkit2gtk-4.0-dev (dropped on ubuntu-24.04).
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v5
with:
go-version: "1.23"
- uses: actions/setup-node@v6
with:
node-version: "22"
- name: Enable pnpm (via corepack)
run: corepack enable
- name: Install Wails system deps
run: |
sudo apt-get update
sudo apt-get install -y build-essential pkg-config libgtk-3-dev libwebkit2gtk-4.0-dev
- name: Install Wails CLI
run: go install github.com/wailsapp/wails/v2/cmd/wails@v2.12.0
- name: Build
# `wails build` generates bindings, installs frontend deps (pnpm),
# type-checks (tsc) + bundles the frontend, then compiles the Go binary.
run: cd desktop && wails build
- name: Lint frontend (ESLint)
# deps + generated bindings already present from the build above.
run: cd desktop/frontend && pnpm lint
44 changes: 44 additions & 0 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Claude Code Review

on:
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
# Optional: Only run on specific file changes
# paths:
# - "src/**/*.ts"
# - "src/**/*.tsx"
# - "src/**/*.js"
# - "src/**/*.jsx"

jobs:
claude-review:
# Optional: Filter by PR author
# if: |
# github.event.pull_request.user.login == 'external-contributor' ||
# github.event.pull_request.user.login == 'new-developer' ||
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'

runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 1

- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
plugins: 'code-review@claude-code-plugins'
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options

50 changes: 50 additions & 0 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Claude Code

on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]

jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 1

- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

# This is an optional setting that allows Claude to read CI results on PRs
additional_permissions: |
actions: read

# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
# prompt: 'Update the pull request description to include a summary of changes.'

# Optional: Add claude_args to customize behavior and configuration
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
# claude_args: '--allowed-tools Bash(gh pr *)'

30 changes: 30 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Commit Lint

# Enforce Conventional Commits (Angular style) so release-please can derive
# versions + changelog. The PR-title check matters most for squash-merges
# (the title becomes the commit on main); the commits check covers merge commits.
on:
pull_request:
types: [opened, edited, synchronize, reopened]

permissions:
contents: read
pull-requests: read

jobs:
pr-title:
name: Lint PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

commits:
name: Lint commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v6
Loading
Loading