Spaces:
Running
Running
| name: Nuclear Intelligence CI/CD | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: pip install flake8 black | |
| - name: Lint | |
| run: | | |
| flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
| black --check . | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| - name: Test import | |
| run: python -c "from core.nuclear_intelligence import NuclearIntelligenceCore; print('✅ Import successful')" | |
| deploy: | |
| needs: [lint, test] | |
| if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GH_TOKEN }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| - name: Push to main | |
| run: | | |
| git config user.name "Nuclear Intelligence Bot" | |
| git config user.email "noreply@nuclear-intelligence.ai" | |
| git add . | |
| git commit -m "Update Nuclear Intelligence v3.0 [CI]" || echo "No changes to commit" | |
| git push |