C
CoderspaE
/Documentation

GitHub Integration

Connect your GitHub repositories with CoderspaE to import problems, sync solutions, and integrate with your development workflow.

Overview

The GitHub integration allows you to seamlessly connect your CoderspaE account with GitHub repositories for enhanced workflow automation and collaboration.

Key Features

  • • Import coding problems from GitHub repositories
  • • Sync your solutions to GitHub automatically
  • • Create pull requests for collaborative problem solving
  • • Track your coding progress with GitHub commits
  • • Integrate with GitHub Actions for automated testing
  • • Import test cases and problem descriptions

GitHub Actions Setup

Quick Setup

Add CoderspaE actions to your GitHub repository for automated testing:

# .github/workflows/coderspae.yml
name: CoderspaE Integration

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: coderspae/action-test@v1
      with:
        api-key: ${{ secrets.CODERSPAE_API_KEY }}
        language: javascript
        test-suite: all

Available Actions

🧪 coderspae/action-test

Run CoderspaE test suites against your code

- uses: coderspae/action-test@v1
  with:
    api-key: ${{ secrets.CODERSPAE_API_KEY }}
    language: javascript
    test-suite: algorithms
    timeout: 30s
    coverage: true

🚀 coderspae/action-deploy

Deploy your solutions to CoderspaE platform

- uses: coderspae/action-deploy@v1
  with:
    api-key: ${{ secrets.CODERSPAE_API_KEY }}
    environment: production
    project-id: my-battle-project
    auto-publish: true

📊 coderspae/action-benchmark

Run performance benchmarks on your algorithms

- uses: coderspae/action-benchmark@v1
  with:
    api-key: ${{ secrets.CODERSPAE_API_KEY }}
    algorithm-path: ./src/algorithms
    benchmark-suite: performance
    report-format: json

Repository Structure

Configure your repository structure for optimal integration:

my-coding-repo/
├── problems/
│   ├── two-sum/
│   │   ├── README.md          # Problem description
│   │   ├── solution.py        # Your solution
│   │   ├── test_cases.json    # Test cases
│   │   └── metadata.json      # Problem metadata
│   └── binary-search/
│       ├── README.md
│       ├── solution.js
│       └── test_cases.json
├── .coderspae/
│   └── config.json           # Integration settings
├── .github/
│   └── workflows/
│       └── coderspae.yml     # CI/CD workflow
└── README.md

Complete Workflow Examples

Continuous Integration

name: CI Pipeline

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        language: [javascript, python, java]
    
    steps:
    - name: Checkout code
      uses: actions/checkout@v4
      
    - name: Setup Node.js
      uses: actions/setup-node@v4
      with:
        node-version: '18'
        
    - name: Install dependencies
      run: npm install
      
    - name: Run CoderspaE tests
      uses: coderspae/action-test@v1
      with:
        api-key: ${{ secrets.CODERSPAE_API_KEY }}
        language: ${{ matrix.language }}
        test-suite: comprehensive
        
    - name: Generate coverage report
      uses: coderspae/action-coverage@v1
      with:
        api-key: ${{ secrets.CODERSPAE_API_KEY }}
        format: lcov
        
    - name: Upload results
      uses: actions/upload-artifact@v4
      with:
        name: test-results-${{ matrix.language }}
        path: coverage/

Tournament Deployment

name: Tournament Deployment

on:
  release:
    types: [published]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    
    - name: Validate solutions
      uses: coderspae/action-validate@v1
      with:
        api-key: ${{ secrets.CODERSPAE_API_KEY }}
        solution-path: ./tournament-solutions
        
    - name: Deploy to tournament
      uses: coderspae/action-tournament-deploy@v1
      with:
        api-key: ${{ secrets.CODERSPAE_API_KEY }}
        tournament-id: ${{ github.event.release.tag_name }}
        solutions-path: ./tournament-solutions
        
    - name: Notify Discord
      uses: coderspae/action-notify@v1
      with:
        webhook-url: ${{ secrets.DISCORD_WEBHOOK }}
        message: "Tournament ${{ github.event.release.tag_name }} deployed!"

Security Configuration

Required Secrets

Add these secrets to your GitHub repository settings:

CODERSPAE_API_KEY

Your CoderspaE API key for authentication

CODERSPAE_PROJECT_ID

Project identifier for deployment

DISCORD_WEBHOOK

Optional: Discord webhook for notifications

Setup Instructions

  1. Go to your GitHub repository
  2. Navigate to Settings → Secrets and variables → Actions
  3. Click New repository secret
  4. Add each required secret with its value
  5. Save and commit your workflow file

Advanced Features

🎯 Conditional Deployment

Deploy only when tests pass and performance benchmarks meet thresholds

- name: Deploy if performance OK
  if: ${{ steps.benchmark.outputs.score >= 85 }}
  uses: coderspae/action-deploy@v1

📈 Performance Tracking

Track algorithm performance over time with automated reports

- uses: coderspae/action-perf-track@v1
  with:
    baseline-branch: main
    report-pr-comment: true

🔄 Multi-language Testing

Test the same algorithm across multiple programming languages

strategy:
  matrix:
    include:
      - lang: js
        path: ./javascript
      - lang: py
        path: ./python

🏆 Tournament Integration

Automatically enter approved solutions into tournaments

- uses: coderspae/action-tournament@v1
  with:
    auto-enter: true
    skill-level: advanced