Skip to content

Latest commit

Β 

History

History
307 lines (231 loc) Β· 7.15 KB

File metadata and controls

307 lines (231 loc) Β· 7.15 KB

GitHub Actions Workflows Setup Guide

This guide covers the setup for three new automated workflows:

  1. Robot Framework Tests - Automated test reports with GitHub Pages
  2. Mobile Builds - Android APK & iOS IPA builds with automatic releases
  3. Jekyll Documentation - Documentation site hosted on GitHub Pages

πŸ“‹ Prerequisites

For All Workflows:

  • GitHub repository with Actions enabled
  • Repository permissions: Settings β†’ Actions β†’ General β†’ Workflow permissions β†’ "Read and write permissions"

For Mobile Builds:

  • EXPO_TOKEN secret configured

πŸ€– 1. Robot Framework Tests Workflow

File: .github/workflows/robot-framework-tests.yml

What It Does:

  • Runs Robot Framework tests on PR or manual trigger
  • Publishes interactive HTML reports to GitHub Pages
  • Posts test summary as PR comment
  • Uploads test artifacts (HTML + XML reports)

Features:

  • βœ… Live test reports accessible via URL
  • βœ… PR comments with pass/fail statistics
  • βœ… Downloadable test artifacts
  • βœ… Backend service startup automation
  • βœ… Service log capture on failure

Triggers:

  • Automatic: PRs that modify robot_tests/ or ushadow/backend/
  • Manual: Actions tab β†’ "Robot Framework Tests" β†’ "Run workflow"

Setup Steps:

No secrets required! Just enable GitHub Pages:

  1. Go to Settings β†’ Pages
  2. Source: GitHub Actions
  3. Save

Expected Output:

On PR:

## πŸŽ‰ Robot Framework Test Results

**Status**: βœ… All tests passed!

| Metric | Count |
|--------|-------|
| βœ… Passed | 15 |
| ❌ Failed | 0 |
| πŸ“Š Total | 15 |

### πŸ“Š View Reports
- [πŸ“‹ Test Report](https://ushadow-io.github.io/Ushadow/report.html)
- [πŸ“ Detailed Log](https://ushadow-io.github.io/Ushadow/log.html)

πŸ“± 2. Mobile Builds Workflow

File: .github/workflows/mobile-builds.yml EAS Config: ushadow/mobile/eas.json

What It Does:

  • Builds Android APK and iOS IPA on push to main or manual trigger
  • Creates GitHub Releases with downloadable binaries
  • Automatic versioning with timestamps
  • Supports building platforms independently

Features:

  • βœ… Android APK (ready to install)
  • βœ… iOS IPA (simulator builds)
  • βœ… Automatic GitHub Releases
  • βœ… Manual trigger with platform selection
  • βœ… Timestamped version tags

Triggers:

  • Automatic: Push to main branch when ushadow/mobile/ changes
  • Manual: Actions tab β†’ "Build Mobile Apps" β†’ Select platforms

Setup Steps:

1. Get Expo Token

  1. Go to expo.dev and sign in
  2. Navigate to Access Tokens
  3. Create new token β†’ Copy it

2. Add GitHub Secret

  1. Settings β†’ Secrets and variables β†’ Actions
  2. Click New repository secret
  3. Name: EXPO_TOKEN
  4. Value: Paste your token
  5. Save

3. First Build

# Test locally first
cd ushadow/mobile
npm install
eas init --force --non-interactive
eas build --platform android --profile local --local

Expected Output:

Creates GitHub Release with:

  • ushadow-mobile-android.apk (Android)
  • ushadow-mobile-ios.ipa (iOS simulator)
  • Installation instructions
  • Build metadata

Release Tag Format: mobile-v1.0.0-20260122-143052


πŸ“š 3. Jekyll Documentation Workflow

File: .github/workflows/jekyll-docs.yml

What It Does:

  • Converts your docs/ folder into a beautiful documentation website
  • Automatically creates Jekyll config if missing
  • Deploys to GitHub Pages on every push to main
  • Supports Markdown with syntax highlighting

Features:

  • βœ… Automatic Jekyll setup
  • βœ… Clean documentation theme (Minima)
  • βœ… Markdown support with code highlighting
  • βœ… SEO optimization
  • βœ… Sitemap generation

Triggers:

  • Automatic: Push to main branch when docs/ changes
  • Manual: Actions tab β†’ "Deploy Jekyll Documentation" β†’ "Run workflow"

Setup Steps:

  1. Enable GitHub Pages:

    • Settings β†’ Pages
    • Source: GitHub Actions
    • Save
  2. Optional - Customize Jekyll:

    cd docs
    
    # Create custom Gemfile (optional)
    cat > Gemfile << 'EOF'
    source "https://rubygems.org"
    gem "jekyll", "~> 4.3"
    gem "minima", "~> 2.5"
    EOF
    
    # Create custom _config.yml (optional)
    cat > _config.yml << 'EOF'
    title: Your Custom Title
    description: Your description
    theme: minima
    EOF
  3. Add index page:

    cd docs
    cat > index.md << 'EOF'
    ---
    layout: home
    title: Home
    ---
    
    # Welcome to Ushadow Documentation
    
    Your documentation content here...
    EOF

Expected Output:

Documentation site available at:

https://ushadow-io.github.io/Ushadow/

πŸš€ Quick Start

Test Everything:

# 1. Commit the new workflows
git add .github/workflows/*.yml ushadow/mobile/eas.json
git commit -m "feat: add CI/CD workflows for tests, mobile, and docs"
git push

# 2. Configure secrets
# Go to Settings β†’ Secrets and variables β†’ Actions
# Add: EXPO_TOKEN

# 3. Enable GitHub Pages
# Settings β†’ Pages β†’ Source: GitHub Actions

# 4. Test each workflow manually:
# Actions tab β†’ Select workflow β†’ Run workflow

πŸ” Viewing Results

Robot Tests:

  • Live Reports: Check PR comment for URLs
  • Artifacts: Actions run β†’ Scroll to "Artifacts" β†’ Download ZIP
  • Logs: Actions run β†’ "Run Robot Framework tests" step

Mobile Builds:

  • Releases: Repository β†’ Releases tab
  • Download: Click on APK/IPA file
  • Logs: Actions run β†’ Build steps

Jekyll Docs:

  • Live Site: Settings β†’ Pages β†’ "Visit site" button
  • Build Status: Actions tab β†’ "Deploy Jekyll Documentation"

πŸ› Troubleshooting

Robot Tests Not Running:

# Check if paths are correct
git diff --name-only origin/main | grep -E "robot_tests|ushadow/backend"

# Manually trigger
# Actions β†’ Robot Framework Tests β†’ Run workflow

Mobile Build Fails:

# Common issues:
# 1. EXPO_TOKEN not set or expired
# 2. EAS not initialized (run: eas init)
# 3. Node modules outdated (run: npm ci)

# Debug locally:
cd ushadow/mobile
npm ci
eas build --platform android --profile local --local

Jekyll Build Fails:

# Common issues:
# 1. Invalid Markdown syntax
# 2. Missing front matter (add --- at top of files)
# 3. Jekyll config errors

# Test locally:
cd docs
bundle install
bundle exec jekyll serve
# Visit http://localhost:4000

πŸ“Š Workflow Status

Check workflow runs:

Repository β†’ Actions tab

View workflow details:

Actions β†’ Select workflow β†’ Click on a run

πŸ”— Useful Links


πŸ’‘ Next Steps

  1. Add Claude Code Integration - Automated code reviews on PRs
  2. Add Docker Build Workflow - Build and push container images
  3. Add Deployment Workflows - Auto-deploy to staging/production

See the workflows/ folder for additional workflow templates from your other project!