Skip to content

add chat overlay and beginnings of claude support #6

add chat overlay and beginnings of claude support

add chat overlay and beginnings of claude support #6

Workflow file for this run

name: CI
on:
push:
pull_request:
# GOFLAGS=-mod=mod allows go commands to update go.sum automatically on the
# bootstrap commit where go.sum has not yet been populated by go mod tidy.
# Remove this env once go.sum is fully committed.
env:
GOFLAGS: -mod=mod
jobs:
lint-go:
name: Lint Go
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.57.2
- name: go vet
run: go vet ./...
lint-web:
name: Lint Web
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: webapp/package-lock.json
- name: Install dependencies
run: npm --prefix webapp ci
- name: TypeScript type check
run: npx --prefix webapp tsc --noEmit
- name: Next.js lint
run: npm --prefix webapp run lint
test-go:
name: Test Go
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
cache: true
- name: Run tests
run: go test -race -coverprofile=coverage.out ./...
- name: Check coverage threshold (≥10%)
run: |
COVERAGE=$(go tool cover -func=coverage.out | grep '^total:' | awk '{print $3}' | tr -d '%')
echo "Total coverage: ${COVERAGE}%"
awk -v cov="$COVERAGE" 'BEGIN { if (cov+0 < 10) { print "Coverage " cov "% is below 10% threshold"; exit 1 } }'
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: go-coverage
path: coverage.out
test-web:
name: Test Web
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: webapp/package-lock.json
- name: Install dependencies
run: npm --prefix webapp ci
- name: Run tests
run: npm --prefix webapp test -- --ci --coverage
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: web-coverage
path: webapp/coverage/
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
cache: true
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: webapp/package-lock.json
- name: Build Go binaries
run: |
mkdir -p bin
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
-ldflags "-X main.version=$(git describe --tags --always --dirty 2>/dev/null || echo dev)" \
-o bin/controller ./cmd/controller
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
-ldflags "-X main.version=$(git describe --tags --always --dirty 2>/dev/null || echo dev)" \
-o bin/oasis ./cmd/oasis
- name: Verify static linkage
run: file ./bin/controller | grep -E 'statically linked|static-pie linked'
- name: Build Next.js static export
run: |
npm --prefix webapp ci
npm --prefix webapp run build
- name: Verify PWA build artifacts
run: |
test -f dist/webapp/sw.js || { echo "ERROR: dist/webapp/sw.js missing"; exit 1; }
test -f dist/webapp/manifest.json || { echo "ERROR: dist/webapp/manifest.json missing"; exit 1; }
node -e "
const m = JSON.parse(require('fs').readFileSync('dist/webapp/manifest.json','utf8'));
const required = ['name','short_name','icons','start_url','display'];
const missing = required.filter(k => !m[k]);
if (missing.length) { console.error('manifest.json missing fields:', missing.join(', ')); process.exit(1); }
console.log('manifest.json OK:', required.join(', '));
"
for f in \
dist/webapp/icons/icon-192.png \
dist/webapp/icons/icon-512.png \
dist/webapp/icons/icon-maskable-192.png \
dist/webapp/icons/icon-maskable-512.png \
dist/webapp/apple-touch-icon.png; do
test -f "$f" || { echo "ERROR: $f missing"; exit 1; }
done
echo "All PWA build artifacts present."
- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
push: false
platforms: linux/amd64
test-integration:
name: Integration Tests (stub)
runs-on: ubuntu-latest
steps:
- name: Not yet implemented
run: echo "Integration tests not yet implemented (work item 0001 stub) — skipping."