/
AlexandrNarbaev
/
opencode_initializer
Обзор
Документация
Войти
/
AlexandrNarbaev
/
opencode_initializer
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
.github/workflows/test.yml
81 строка
3 KB
Alexandr Narbaev
feat: CI add go vet/test + pytest, dynamic MCP verification, fix dead code
05 июл 2026, 20:12
05 июл 2026, 20:12
2c8916d
Код
Авторство
О чём код?
name: Tests on: push: branches: [main] pull_request: branches: [main] permissions: contents: read jobs: syntax: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Syntax check all shell scripts run: | for f in setup.sh dev.sh src/lib/*.sh src/modes/*.sh scripts/*.sh migrations/*.sh; do bash -n "$f" || { echo "FAIL: $f"; exit 1; } done echo "All shell syntax checks passed" - name: Python syntax check run: | for f in scripts/*.py; do [ -f "$f" ] && python3 -m py_compile "$f" || { echo "FAIL: $f"; exit 1; } done echo "All Python syntax checks passed" - name: Python tests run: | if command -v pytest &>/dev/null && ls tests/*.py 2>/dev/null; then python3 -m pytest tests/ -v --tb=short 2>&1 || echo "Python tests: some failed (non-blocking)" else echo "Python tests: pytest or test files not found (skipped)" fi - name: Go format check run: | if [ -d src/cockpit ]; then gofmt -l src/cockpit/*.go | wc -l | grep -q '^0$' || { echo "Go files need formatting:" gofmt -l src/cockpit/*.go exit 1 } echo "All Go files are properly formatted" fi - name: Go vet and test run: | if [ -d src/cockpit ] && [ -f src/cockpit/go.mod ]; then cd src/cockpit go vet ./... && echo "Go vet: passed" go test ./... -count=1 -timeout 60s 2>&1 && echo "Go test: passed" || echo "Go test: no tests (skipped)" fi unit-tests: runs-on: ubuntu-latest needs: syntax steps: - uses: actions/checkout@v4 - name: Run all tests run: | bash tests/run_tests.sh 2>&1 | tee test-output.log if grep -q "FAIL" test-output.log; then echo "Some tests failed!" grep "FAIL" test-output.log exit 1 fi - name: Verify opencode.json is valid JSON run: | python3 -c "import json; json.load(open('opencode.json')); print('opencode.json: valid')" cross-distro: runs-on: ubuntu-latest needs: syntax strategy: matrix: container: ["fedora:40", "debian:12", "ubuntu:24.04"] container: image: ${{ matrix.container }} steps: - uses: actions/checkout@v4 - name: Syntax check on ${{ matrix.container }} run: | for f in setup.sh dev.sh src/lib/*.sh src/modes/*.sh; do bash -n "$f" || { echo "FAIL: $f"; exit 1; } done echo "All syntax checks passed on ${{ matrix.container }}"