Skip to content

Initial commit: OpenCode Ecosystem v4.2 #83

Initial commit: OpenCode Ecosystem v4.2

Initial commit: OpenCode Ecosystem v4.2 #83

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
pages: write
id-token: write
jobs:
validate:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
node-version: ["20"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Python Setup
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
test -f requirements.txt && pip install -r requirements.txt || true
pip install pytest ruff mypy
# Node.js Setup
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install Node.js dependencies
run: |
test -f package.json && npm install || true
# Python Linting
- name: Run ruff linter
run: ruff check . --line-length=100 --ignore=E501,F401 --statistics || true
- name: Run mypy type checking
run: mypy . --ignore-missing-imports --follow-imports=skip || true
# Python Tests
- name: Run pytest suite
run: python -m pytest tests/ -v --tb=short || true
# TDD Validator
- name: Run TDD validator
run: |
if [ -d "tdd-docs" ]; then
echo "Running TDD validation..."
python -m pytest tdd-docs/ -v --tb=short 2>/dev/null || true
else
echo "No tdd-docs/ directory found, skipping TDD validation"
fi
# LaTeX Validation
- name: Check LaTeX availability
id: latex-check
run: |
if command -v pdflatex &> /dev/null; then
echo "latex_available=true" >> $GITHUB_OUTPUT
else
echo "latex_available=false" >> $GITHUB_OUTPUT
echo "pdflatex not found"
fi
- name: Install TeX Live (if needed)
if: steps.latex-check.outputs.latex_available == 'false'
run: |
sudo apt-get update
sudo apt-get install -y texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-lang-portuguese
- name: Validate LaTeX compilation
run: |
latex_files=$(find . -maxdepth 2 -name "*.tex" -type f)
if [ -n "$latex_files" ]; then
echo "Found LaTeX files to validate"
for file in $latex_files; do
dir=$(dirname "$file")
name=$(basename "$file" .tex)
echo "Compiling: $file"
cd "$dir"
pdflatex -interaction=nonstopmode -halt-on-error "${name}.tex" 2>&1 || true
cd "$GITHUB_WORKSPACE"
done
else
echo "No LaTeX files found in repository root (depth 2)"
fi
# Repository Structure Validation
- name: Validate repository structure
run: |
for dir in agents skills opencode.json; do
if [ ! -e "$dir" ]; then
echo "Missing: $dir"
fi
done
echo "Repository structure validated"
# Generate PDF Artifacts
- name: Generate PDF artifacts
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
mkdir -p artifacts
find . -maxdepth 3 -name "*.pdf" -type f -not -path "./artifacts/*" -exec cp {} artifacts/ \;
echo "OpenCode Ecosystem - Health Summary" > artifacts/health-summary.txt
echo "Generated: $(date -u '+%Y-%m-%d %H:%M:%S UTC')" >> artifacts/health-summary.txt
echo "Python: ${{ matrix.python-version }}" >> artifacts/health-summary.txt
echo "Node.js: ${{ matrix.node-version }}" >> artifacts/health-summary.txt
- name: Upload PDF artifacts
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: opencode-artifacts-${{ github.sha }}
path: artifacts/
retention-days: 7