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
124 changes: 124 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Continuous Integration

on:
pull_request:
push:
branches:
- main

jobs:
pr-tests:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
name: Run Tests
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Ensure test scripts are executable
run: |
if compgen -G "test/*.sh" > /dev/null; then
chmod +x test/*.sh
fi

- name: Execute pull request tests
run: |
set -euo pipefail
if compgen -G "test/*.sh" > /dev/null; then
for test_script in test/*.sh; do
echo "Running ${test_script}"
bash "${test_script}"
done
else
echo "No tests found in ./test"
fi

pr-report:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
name: Report Tests Statuses
needs:
- pr-tests
steps:
- name: Summarize pull request test results
run: echo "Pull request tests completed successfully."

main-build:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
name: Build and Upload Artifacts
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build static site
run: |
set -euo pipefail
mkdir -p build
cp index.html build/
cp style.css build/
cp landing.js build/

- name: Upload static site artifact
uses: actions/upload-artifact@v4
with:
name: static-site
path: build

main-report-build:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
name: Report Build Status
needs:
- main-build
steps:
- name: Report build outcome
run: echo "Static site build completed successfully."

main-tests:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
name: Run Tests
needs:
- main-build
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Ensure test scripts are executable
run: |
if compgen -G "tests/*.sh" > /dev/null; then
chmod +x tests/*.sh
fi

- name: Execute main branch tests
run: |
set -euo pipefail
if compgen -G "tests/*.sh" > /dev/null; then
for test_script in tests/*.sh; do
echo "Running ${test_script}"
bash "${test_script}"
done
else
echo "No tests found in ./tests"
fi

main-report-tests:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
name: Report Tests Statuses
needs:
- main-tests
steps:
- name: Summarize main branch test results
run: echo "Main branch tests completed successfully."

deploy-pages:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
name: Deploy to Pages
needs:
- main-build
steps:
- name: Deploy placeholder
run: echo "Deploying static site to GitHub Pages (placeholder)."
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Talk to Unity in Plain English

![Main Branch Workflow Status](https://github.com/Unity-Lab-AI/Talk-to-Unity/actions/workflows/main.yml/badge.svg?branch=main)
![Pull Request Workflow Status](https://github.com/Unity-Lab-AI/Talk-to-Unity/actions/workflows/pull-request.yml/badge.svg)
[![Main Pipeline Status](https://github.com/Unity-Lab-AI/Talk/actions/workflows/continuous-integration.yml/badge.svg?branch=main)](https://github.com/Unity-Lab-AI/Talk/actions/workflows/continuous-integration.yml)
[![Pull Request Checks](https://github.com/Unity-Lab-AI/Talk/actions/workflows/continuous-integration.yml/badge.svg?event=pull_request)](https://github.com/Unity-Lab-AI/Talk/actions/workflows/continuous-integration.yml)

Talk to Unity is a single web page that acts like a friendly concierge. The landing screen double-checks that your browser has everything it needs (secure connection, microphone, speech tools). Once every light turns green, a voice assistant named **Unity** wakes up so you can talk out loud and hear it answer back.

Expand Down
11 changes: 11 additions & 0 deletions test/site_structure_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail

echo "Checking that index.html exists..."
[ -f "index.html" ]
echo "Checking that landing.js exists..."
[ -f "landing.js" ]
echo "Checking that style.css exists..."
[ -f "style.css" ]

echo "All required site files are present."
9 changes: 9 additions & 0 deletions tests/content_integrity_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail

if ! grep -q "<title>" index.html; then
echo "index.html is missing a <title> element"
exit 1
fi

echo "Verified that index.html contains a <title> element."