Skip to content
Merged
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
160 changes: 160 additions & 0 deletions .github/workflows/main-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
name: Main Branch Delivery

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
name: Build and Upload Artifacts
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Build static site bundle
run: |
python - <<'PY'
import json
import shutil
import time
from pathlib import Path

start = time.perf_counter()
root = Path('.')
dist = Path('dist')
if dist.exists():
shutil.rmtree(dist)
dist.mkdir(parents=True, exist_ok=True)

for asset in ['index.html', 'style.css', 'app.js', 'ai-instruct.txt']:
shutil.copy2(root / asset, dist / asset)

duration = time.perf_counter() - start
report_dir = Path('ci_reports')
report_dir.mkdir(parents=True, exist_ok=True)
(report_dir / 'build_status.json').write_text(
json.dumps(
{
'status': 'succeeded',
'artifact': 'github-pages',
'duration': duration,
},
indent=2,
)
)
PY

- name: Upload static artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist

- name: Upload build report
if: always()
uses: actions/upload-artifact@v4
with:
name: build-status-report
path: ci_reports/build_status.json
if-no-files-found: warn

report-build:
name: Report Build Status
runs-on: ubuntu-latest
needs: build
if: ${{ always() && needs.build.result != 'cancelled' }}

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Download build report
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: build-status-report
path: ci_reports

- name: Render build summary
run: python scripts/report_build.py

run-tests:
name: Run Tests
runs-on: ubuntu-latest
needs: build

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Run Tests
run: python tests/run_tests.py

- name: Upload test report
if: always()
uses: actions/upload-artifact@v4
with:
name: main-test-report
path: ci_reports/test_results.json
if-no-files-found: warn

report-tests:
name: Report Tests Statuses
runs-on: ubuntu-latest
needs: run-tests
if: ${{ always() && needs.run-tests.result != 'cancelled' }}

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Download test report
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: main-test-report
path: ci_reports

- name: Render summary
run: python scripts/report_tests.py

deploy:
name: Deploy to Pages
runs-on: ubuntu-latest
needs: build
if: ${{ needs.build.result == 'success' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4
53 changes: 53 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Pull Request Checks

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
run-tests:
name: Run Tests
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Run Tests
run: python tests/run_tests.py

- name: Upload test report
if: always()
uses: actions/upload-artifact@v4
with:
name: pr-test-report
path: ci_reports/test_results.json
if-no-files-found: warn

report-tests:
name: Report Tests Statuses
runs-on: ubuntu-latest
needs: run-tests

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Download test report
uses: actions/download-artifact@v4
with:
name: pr-test-report
path: ci_reports

- name: Render summary
run: python scripts/report_tests.py
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
__pycache__/
*.py[cod]
ci_reports/*.json
dist/
.env
86 changes: 55 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,55 @@
# Voice Chat App

[![Pull Request Workflow Status](../../actions/workflows/pull-request.yml/badge.svg)](../../actions/workflows/pull-request.yml)
[![Main Branch Workflow Status](../../actions/workflows/main-branch.yml/badge.svg?branch=main)](../../actions/workflows/main-branch.yml)
[![Main Branch Tests](../../actions/workflows/main-branch.yml/badge.svg?branch=main&job=Run%20Tests)](../../actions/workflows/main-branch.yml)

A lightweight voice chat application prototype with automated continuous
integration. The workflows are designed so that deployments and pull requests
are never blocked by automated checks while still surfacing rich status
information.

## Continuous Integration

- **Pull Request Workflow** runs on every pull request event and executes all
tests located in the `tests/` directory. It publishes a markdown summary with
the individual results for quick review.
- **Main Branch Workflow** runs when changes land on `main`. It builds the static
site bundle, uploads artifacts, deploys to GitHub Pages, and runs the same test
suite. Build and test summaries are exposed through job outputs and workflow
badges for quick visibility.

## Local Testing

To execute the same checks locally, run:

```bash
python tests/run_tests.py
```

The command writes a structured report to `ci_reports/test_results.json` that the
workflows reuse when generating their summaries.
# Unity Voice Chat Preview

[![Pull Request Workflow Status](../../actions/workflows/pull-request.yml/badge.svg)](../../actions/workflows/pull-request.yml)
[![Main Branch Workflow Status](../../actions/workflows/main-branch.yml/badge.svg?branch=main)](../../actions/workflows/main-branch.yml)
[![Main Branch Tests](../../actions/workflows/main-branch.yml/badge.svg?branch=main&job=Run%20Tests)](../../actions/workflows/main-branch.yml)

A responsive, speech-driven art experience powered by the Pollinations Unity
model. The interface now features dedicated activity monitors for Unity (left)
and the user microphone (right) so it is clear who is speaking at all times.
The microphone toggle stays anchored to the bottom of the screen for easy access
on both mobile and desktop.

## Features

- **Dual voice monitors** – modern circular visualizers spaced using the rule of
thirds, highlighting Unity (left) and the user (right) with independent
activity states.
- **Bottom-aligned mute control** – a persistent, centered control that guides
users through granting microphone permissions and starting conversations.
- **Graceful voice handling** – contextual ARIA labels, explicit error feedback,
and automatic re-listening when the browser allows continuous recognition.
- **Dynamic imagery** – every prompt swaps the blurred cinematic background using
the selected Pollinations image model (`flux`, `turbo`, or `kontext`).

## Continuous Integration

Two separate GitHub Actions workflows keep deployments fast and informative:

- **Pull Request Checks** (`.github/workflows/pull-request.yml`)
- Runs on every pull request update.
- Executes each script under `tests/` via `tests/run_tests.py`.
- Publishes a markdown summary of individual test results.

- **Main Branch Delivery** (`.github/workflows/main-branch.yml`)
- Triggers on pushes to `main` and manual dispatches.
- Builds the static bundle, uploads the GitHub Pages artifact, and records a
machine-readable build summary.
- Executes the same test suite and reports results without blocking deploys.
- Deploys successful builds to GitHub Pages.

Badges at the top of this document surface the latest workflow and main-branch
test status directly from GitHub Actions.

## Local Development

Install the lightweight test dependency and run the suite:

```bash
python -m pip install --upgrade pip
pip install -r requirements.txt
python tests/run_tests.py
```

The runner writes a structured report to `ci_reports/test_results.json` that the
workflows reuse when generating their summaries.
Loading
Loading