gitignore #3
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: CI - Quick Check | |
| # Fast feedback loop for PRs and commits | |
| # Runs only critical tests with maximum parallelization | |
| # Full test suite runs on main branch or can be triggered manually | |
| on: | |
| push: | |
| branches-ignore: [ main ] | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| NODE_VERSION: '20.x' | |
| PYTHON_VERSION: '3.10' | |
| jobs: | |
| # ============================================ | |
| # Quick validation (lint, type check, fast tests) | |
| # ============================================ | |
| quick-check: | |
| name: Quick Validation | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| services: | |
| redis: | |
| image: redis:7-alpine | |
| ports: | |
| - 6379:6379 | |
| mongodb: | |
| image: mongo:6 | |
| ports: | |
| - 27017:27017 | |
| env: | |
| MONGO_INITDB_ROOT_USERNAME: testuser | |
| MONGO_INITDB_ROOT_PASSWORD: testpass | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| cache: 'pip' | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| cache-dependency-path: 'frontend/package-lock.json' | |
| - name: Install Python dependencies | |
| run: | | |
| cd backend | |
| pip install -r requirements.txt | |
| pip install pytest-xdist pytest-timeout flake8 black PyNaCl base58 | |
| - name: Install Node dependencies | |
| run: | | |
| cd frontend | |
| npm ci | |
| - name: Python linting (flake8) | |
| continue-on-error: true | |
| run: | | |
| cd backend | |
| flake8 routes/ services/ middleware/ --max-line-length=120 --statistics || true | |
| - name: Python formatting check (black) | |
| continue-on-error: true | |
| run: | | |
| cd backend | |
| black --check routes/ services/ middleware/ --line-length=120 || true | |
| - name: Generate signing keys | |
| id: gen_keys | |
| run: | | |
| cd backend | |
| python gen_keys.py > keys_output.txt | |
| PUBLIC_KEY=$(grep "PUBLIC KEY:" keys_output.txt | awk '{print $3}') | |
| PRIVATE_KEY=$(grep "PRIVATE KEY:" keys_output.txt | awk '{print $3}') | |
| echo "public_key=$PUBLIC_KEY" >> $GITHUB_OUTPUT | |
| echo "private_key=$PRIVATE_KEY" >> $GITHUB_OUTPUT | |
| rm keys_output.txt | |
| - name: Create backend .env | |
| run: | | |
| cd backend | |
| printf '%s\n' \ | |
| "MONGO_ATLAS_URI=mongodb://testuser:testpass@mongodb:27017/?authSource=admin" \ | |
| "REDIS_HOST=localhost" \ | |
| "REDIS_PORT=6379" \ | |
| "SIGNER_PUBLIC_KEY=${{ steps.gen_keys.outputs.public_key }}" \ | |
| "SIGNER_PRIVATE_KEY=${{ steps.gen_keys.outputs.private_key }}" \ | |
| "RESILIENTDB_BASE_URI=https://crow.resilientdb.com" \ | |
| "RES_DB_BASE_URI=https://crow.resilientdb.com" \ | |
| "RESILIENTDB_GRAPHQL_URI=https://cloud.resilientdb.com/graphql" \ | |
| "JWT_SECRET=test-secret" > .env | |
| - name: Run backend unit tests only (fast) | |
| run: | | |
| cd backend | |
| pytest tests/unit/ -n auto -v --tb=short \ | |
| --maxfail=5 \ | |
| --timeout=30 \ | |
| -q | |
| - name: Run frontend unit tests (fast) | |
| run: | | |
| cd frontend | |
| npm test -- --watchAll=false --maxWorkers=4 \ | |
| --testPathIgnorePatterns='Canvas.test.js|Dashboard.test.js' \ | |
| --coverage=false \ | |
| --ci | |
| - name: Build check (frontend) | |
| run: | | |
| cd frontend | |
| npm run build | |
| - name: Comment PR with quick results | |
| if: github.event_name == 'pull_request' && always() | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const jobStatus = '${{ job.status }}'; | |
| const emoji = jobStatus === 'success' ? '✅' : '❌'; | |
| const summary = `${emoji} **Quick Check ${jobStatus}** | |
| Fast validation completed for commit ${{ github.sha }} | |
| This is a quick feedback run. Full test suite will run on merge to main. | |
| `; | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: summary | |
| }); |