- Viewer accessibility: 5 tests (aria-labels, aria-expanded, label association, alert role) - Viewer responsive: 3 tests (chat-collapsed, CSS grid, now-playing aria-live) - Admin accessibility: 3 tests (nav aria-label, aria-current, focusability) - Admin responsive: 2 tests (tab visibility, essential tabs) - Coverage: vitest v8 provider, 40% stmt/lines, 30% branches/funcs - CI: test:coverage step between lint and build - Total: 44 frontend tests (31 + 13 new) - Updated TODO.md (Phase 2+3 done), DONE.md, MEMORY.md
148 lines
4.7 KiB
YAML
148 lines
4.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: [ubuntu-latest]
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
|
|
- name: Install Frontend Dependencies
|
|
run: cd frontend && npm ci
|
|
|
|
- name: Lint Frontend
|
|
run: cd frontend && npm run lint
|
|
|
|
- name: Test Frontend with Coverage
|
|
run: cd frontend && npm run test:coverage
|
|
|
|
- name: Build Frontend
|
|
run: cd frontend && npm run build
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.25"
|
|
env:
|
|
GOTOOLCHAIN: local
|
|
|
|
- name: Download Go modules
|
|
run: cd backend/chat && GOTOOLCHAIN=local go mod download
|
|
|
|
- name: Validate Go
|
|
run: cd backend/chat && GOTOOLCHAIN=local go vet ./...
|
|
|
|
- name: Run Tests
|
|
run: cd backend/chat && GOTOOLCHAIN=local go test ./... -v -cover -coverprofile=coverage.out -race
|
|
|
|
- name: Check Coverage
|
|
run: |
|
|
cd backend/chat
|
|
COVERAGE=$(GOTOOLCHAIN=local go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//')
|
|
echo "Coverage: $COVERAGE%"
|
|
if [ "$(echo "$COVERAGE < 50" | bc)" -eq 1 ]; then
|
|
echo "Coverage $COVERAGE% below 50% threshold"
|
|
exit 1
|
|
fi
|
|
|
|
docker:
|
|
needs: test
|
|
runs-on: [ubuntu-latest]
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Gitea Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: git.allucanget.biz
|
|
username: ${{ secrets.CI_REGISTRY_USER }}
|
|
password: ${{ secrets.CI_REGISTRY_TOKEN }}
|
|
|
|
- name: Extract metadata for Playout
|
|
id: meta-playout
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: git.allucanget.biz/zwitschi/linearvoid/playout
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=ref,event=pr
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=raw,value=latest,enable={{is_default_branch}}
|
|
|
|
- name: Build and push Playout image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./backend/playout
|
|
file: ./backend/playout/Dockerfile
|
|
push: true
|
|
tags: ${{ steps.meta-playout.outputs.tags }}
|
|
labels: ${{ steps.meta-playout.outputs.labels }}
|
|
cache-from: type=registry,ref=git.allucanget.biz/zwitschi/linearvoid/buildcache:playout
|
|
cache-to: type=registry,ref=git.allucanget.biz/zwitschi/linearvoid/buildcache:playout,mode=max
|
|
|
|
- name: Extract metadata for Chat
|
|
id: meta-chat
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: git.allucanget.biz/zwitschi/linearvoid/chat
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=ref,event=pr
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=raw,value=latest,enable={{is_default_branch}}
|
|
|
|
- name: Build and push Chat image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./backend/chat
|
|
push: true
|
|
tags: ${{ steps.meta-chat.outputs.tags }}
|
|
labels: ${{ steps.meta-chat.outputs.labels }}
|
|
cache-from: type=registry,ref=git.allucanget.biz/zwitschi/linearvoid/buildcache:chat
|
|
cache-to: type=registry,ref=git.allucanget.biz/zwitschi/linearvoid/buildcache:chat,mode=max
|
|
|
|
- name: Extract metadata for Nginx
|
|
id: meta-nginx
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: git.allucanget.biz/zwitschi/linearvoid/nginx
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=ref,event=pr
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=raw,value=latest,enable={{is_default_branch}}
|
|
|
|
- name: Build and push Nginx image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: infrastructure/nginx/Dockerfile
|
|
push: true
|
|
tags: ${{ steps.meta-nginx.outputs.tags }}
|
|
labels: ${{ steps.meta-nginx.outputs.labels }}
|
|
cache-from: type=registry,ref=git.allucanget.biz/zwitschi/linearvoid/buildcache:nginx
|
|
cache-to: type=registry,ref=git.allucanget.biz/zwitschi/linearvoid/buildcache:nginx,mode=max
|