UI redesign — v1 (React 19 + Tailwind 4 + shadcn/ui) #76
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: test (${{ matrix.os }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| CGO_ENABLED: "1" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| # mattn/go-sqlite3 needs a C compiler. Ubuntu has gcc by default; | |
| # macOS has Xcode CLT on GitHub runners. | |
| - name: Assert C toolchain (macOS) | |
| if: runner.os == 'macOS' | |
| run: clang --version | |
| - name: Go build cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/go-build | |
| ~/Library/Caches/go-build | |
| ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: go vet (cgo + fts5) | |
| run: CGO_ENABLED=1 go vet -tags sqlite_fts5 $(go list ./... | grep -v /ui/node_modules/) | |
| - name: go test (cgo + fts5) | |
| run: CGO_ENABLED=1 go test -tags sqlite_fts5 -timeout 300s $(go list ./... | grep -v /ui/node_modules/) | |
| - name: go build (cgo + fts5) | |
| run: CGO_ENABLED=1 go build -tags sqlite_fts5 -o docsiq ./ | |
| - name: Upload docsiq binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docsiq-${{ matrix.os }} | |
| path: docsiq | |
| retention-days: 7 | |
| if-no-files-found: error | |
| test-integration: | |
| name: integration tests (-race) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| - name: cache go build | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/go-build | |
| ~/go/pkg/mod | |
| key: go-integ-${{ hashFiles('go.sum') }} | |
| - name: integration tests | |
| run: CGO_ENABLED=1 go test -tags "sqlite_fts5 integration" -race -timeout 600s ./... | |
| ui-freshness: | |
| name: ui-dist freshness | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: ui/package-lock.json | |
| - name: Install UI dependencies | |
| run: npm --prefix ui ci | |
| - name: Build UI | |
| run: npm --prefix ui run build | |
| - name: vitest | |
| run: npm --prefix ui test -- --run --coverage | |
| - name: verify ui/dist/ matches fresh build | |
| run: | | |
| if ! git diff --exit-code -- ui/dist/; then | |
| echo "::error::ui/dist/ is stale. Run 'npm --prefix ui run build' and commit the result." | |
| exit 1 | |
| fi | |
| - name: Assert bundle budget (≤ 580 KB JS + CSS, initial chunk) | |
| run: | | |
| set -eu | |
| js_bytes=$(stat -c %s ui/dist/assets/index-*.js 2>/dev/null || stat -f %z ui/dist/assets/index-*.js) | |
| css_bytes=$(stat -c %s ui/dist/assets/index-*.css 2>/dev/null || stat -f %z ui/dist/assets/index-*.css) | |
| total=$((js_bytes + css_bytes)) | |
| echo "bundle: ${js_bytes} js + ${css_bytes} css = ${total} bytes" | |
| # Budget: 580 KB for the initial chunk (lazy markdown/graph/editor | |
| # chunks excluded from this gate by the glob above). | |
| if [ "$total" -gt 593920 ]; then | |
| echo "::error::Bundle ${total} B exceeds 580 KB budget" | |
| exit 1 | |
| fi |