Merge remote-tracking branch 'upstream/v4.2' into master - resolvidos… #126
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: OpenCode Ecosystem CI/CD | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| academic-tests: | |
| name: Academic Tests (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, ubuntu-latest] | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pytest numpy scipy | |
| - name: CORA-Eval Tests (D1-D10) | |
| run: | | |
| python -m pytest artigo/evaluations/tests/test_d1_matematica.py -v --tb=short | |
| python -m pytest artigo/evaluations/tests/test_d2_fisica.py -v --tb=short | |
| python -m pytest artigo/evaluations/tests/test_d9_metodologia.py -v --tb=short | |
| python -m pytest artigo/evaluations/tests/test_anticircularidade.py -v --tb=short | |
| python -m pytest artigo/evaluations/tests/test_evolucao_m4.py -v --tb=short | |
| - name: CORA-Eval Script Tests | |
| run: | | |
| python artigo/evaluations/tests/test_d3_estatistica.py | |
| python artigo/evaluations/tests/test_d4_quimica.py | |
| python artigo/evaluations/tests/test_d5_biologia.py | |
| python artigo/evaluations/tests/test_d6_geociencias.py | |
| python artigo/evaluations/tests/test_d7_codigo.py | |
| python artigo/evaluations/tests/test_d8_literatura.py | |
| python artigo/evaluations/tests/test_d10_gat.py | |
| - name: External Validation | |
| run: | | |
| python artigo/evaluations/tests/test_exaustivo_final.py | |
| - name: Setup TeX Live (Ubuntu only) | |
| if: runner.os == 'Linux' | |
| 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: LaTeX Quality Tests | |
| if: runner.os == 'Linux' | |
| working-directory: artigo | |
| run: | | |
| pdflatex -interaction=nonstopmode artigo_150_questoes.tex | |
| pdflatex -interaction=nonstopmode artigo_150_questoes.tex | |
| python -m pytest tests/test_compile.py -v --tb=short | |
| python -m pytest tests/test_structure.py -v --tb=short | |
| python -m pytest tests/test_quality.py -v --tb=short | |
| - name: Upload test artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-${{ matrix.os }} | |
| path: | | |
| artigo/evaluations/tests/reports/ | |
| artigo/tests/reports/ | |
| retention-days: 30 | |
| ecosystem-validation: | |
| name: Ecosystem Validation | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.12"] | |
| node-version: ["20"] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - 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 | |
| - 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 | |
| - 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 | |
| - name: Run pytest suite | |
| run: python -m pytest tests/ -v --tb=short || true | |
| - 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 | |
| - 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 | |
| - 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" | |
| - 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 |