bd8a7da379
Each sub-project (gui, api, infra) now owns its own Makefile, and the root Makefile is a lean delegator for the base commands (run, build, test, clean, fmt). Odin source, deps, and web assets live under gui/ (gui/src, gui/lib, gui/www), with scripts kept under gui/scripts for build tooling only.
121 lines
2.7 KiB
YAML
121 lines
2.7 KiB
YAML
# Runs on pull requests: unit tests plus a compile check.
|
|
# Split into separate jobs (Odin, API, Infra) so they can run concurrently,
|
|
# and gated by changed paths so each only runs when its code changes.
|
|
# Infra always runs regardless of what changed.
|
|
|
|
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
paths-ignore:
|
|
- '*.md'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
# Odin release to use (matches `dev-2026-07`, the version used locally).
|
|
# Bump this when you want CI to track a newer Odin release.
|
|
ODIN_VERSION: dev-2026-07
|
|
|
|
jobs:
|
|
changes:
|
|
name: Detect changed paths
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
outputs:
|
|
odin: ${{ steps.filter.outputs.odin }}
|
|
api: ${{ steps.filter.outputs.api }}
|
|
steps:
|
|
- uses: dorny/paths-filter@v4
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
odin:
|
|
- 'gui/**'
|
|
- 'scripts/**'
|
|
api:
|
|
- 'api/**'
|
|
|
|
odin:
|
|
name: Odin unit tests and build
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.odin == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install Odin ${{ env.ODIN_VERSION }}
|
|
run: scripts/install_odin.sh
|
|
|
|
- name: Install clang
|
|
run: |
|
|
if command -v sudo >/dev/null 2>&1; then
|
|
sudo apt-get update
|
|
sudo apt-get install -y clang
|
|
else
|
|
apt-get update
|
|
apt-get install -y clang
|
|
fi
|
|
|
|
- name: Run Odin unit tests
|
|
run: make -C gui test
|
|
|
|
- name: Verify build
|
|
run: make -C gui build
|
|
|
|
api:
|
|
name: API unit tests and lint
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.api == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Test Rust API
|
|
run: |
|
|
cd api
|
|
cargo test
|
|
|
|
- name: Lint Rust API
|
|
run: |
|
|
cd api
|
|
cargo clippy --all-targets -- -D warnings
|
|
|
|
- name: Format-check Rust API
|
|
run: |
|
|
cd api
|
|
cargo fmt --all --check
|
|
|
|
infra:
|
|
name: Infra unit tests and vet
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
submodules: recursive
|
|
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version: '1.26'
|
|
|
|
- name: Run Go tests
|
|
run: |
|
|
cd infra
|
|
go mod download
|
|
go test ./...
|
|
|
|
- name: Vet Go code
|
|
run: |
|
|
cd infra
|
|
go vet ./...
|