-
Notifications
You must be signed in to change notification settings - Fork 18
199 lines (169 loc) · 6.71 KB
/
ci.yml
File metadata and controls
199 lines (169 loc) · 6.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
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