feat(frontend): live countdown timer + search bar for bounties #994
Workflow file for this run
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
| # CI Pipeline - Runs on every Pull Request | |
| # Performs linting, type checking, unit tests, and build checks | |
| name: CI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| types: [opened, synchronize, reopened] | |
| concurrency: | |
| group: ci-${{ github.head_ref }} | |
| cancel-in-progress: true | |
| env: | |
| PYTHON_VERSION: '3.11' | |
| NODE_VERSION: '20' | |
| RUST_VERSION: '1.85' | |
| jobs: | |
| # ==================== BACKEND (Python/FastAPI) ==================== | |
| backend-lint: | |
| name: Backend Lint (Ruff) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install Ruff | |
| run: pip install ruff | |
| - name: Run Ruff Linter | |
| working-directory: backend | |
| run: ruff check . --output-format=github | |
| - name: Run Ruff Formatter Check | |
| working-directory: backend | |
| run: ruff format . --check --diff | |
| backend-tests: | |
| name: Backend Tests (pytest) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| cache: 'pip' | |
| cache-dependency-path: backend/requirements.txt | |
| - name: Install Dependencies | |
| working-directory: backend | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install pytest pytest-asyncio pytest-cov | |
| - name: Run Unit Tests | |
| working-directory: backend | |
| run: pytest tests/ -v --tb=short --cov=app --cov-report=xml --cov-report=term-missing | |
| env: | |
| PYTHONPATH: . | |
| SECRET_KEY: test-secret-key-for-ci | |
| # ==================== FRONTEND (React/TypeScript) ==================== | |
| frontend-setup: | |
| name: Frontend Setup Check | |
| runs-on: ubuntu-latest | |
| outputs: | |
| has_package_json: ${{ steps.check.outputs.has_package_json }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Check for package.json | |
| id: check | |
| run: | | |
| if [ -f "frontend/package.json" ]; then | |
| echo "has_package_json=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "has_package_json=false" >> $GITHUB_OUTPUT | |
| echo "::notice::No package.json found - skipping frontend CI jobs" | |
| fi | |
| frontend-lint: | |
| name: Frontend Lint (ESLint) | |
| runs-on: ubuntu-latest | |
| needs: frontend-setup | |
| if: needs.frontend-setup.outputs.has_package_json == 'true' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install Dependencies | |
| working-directory: frontend | |
| run: npm install | |
| - name: Run ESLint | |
| working-directory: frontend | |
| run: npm run lint --if-present | |
| frontend-typecheck: | |
| name: Frontend Type Check (tsc) | |
| runs-on: ubuntu-latest | |
| needs: frontend-setup | |
| if: needs.frontend-setup.outputs.has_package_json == 'true' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install Dependencies | |
| working-directory: frontend | |
| run: npm install | |
| - name: Run TypeScript Type Check | |
| working-directory: frontend | |
| run: npx tsc --noEmit | |
| frontend-tests: | |
| name: Frontend Tests (Vitest) | |
| runs-on: ubuntu-latest | |
| needs: frontend-setup | |
| if: needs.frontend-setup.outputs.has_package_json == 'true' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install Dependencies | |
| working-directory: frontend | |
| run: npm install | |
| - name: Run Unit Tests | |
| working-directory: frontend | |
| run: npm run test -- --run --coverage | |
| continue-on-error: true | |
| frontend-build: | |
| name: Frontend Build (Next.js) | |
| runs-on: ubuntu-latest | |
| needs: frontend-setup | |
| if: needs.frontend-setup.outputs.has_package_json == 'true' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install Dependencies | |
| working-directory: frontend | |
| run: npm install | |
| - name: Build | |
| working-directory: frontend | |
| run: npm run build | |
| env: | |
| NODE_ENV: production | |
| # ==================== CONTRACTS (Solana/Anchor) ==================== | |
| contracts-check: | |
| name: Contracts Check (Anchor) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Check for Anchor.toml | |
| id: check | |
| run: | | |
| if [ -f "contracts/Anchor.toml" ]; then | |
| echo "has_anchor=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "has_anchor=false" >> $GITHUB_OUTPUT | |
| echo "::notice::No Anchor.toml found - skipping Anchor build" | |
| fi | |
| - name: Install Rust | |
| if: steps.check.outputs.has_anchor == 'true' | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: ${{ env.RUST_VERSION }} | |
| - name: Install Solana CLI | |
| if: steps.check.outputs.has_anchor == 'true' | |
| run: | | |
| sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)" | |
| echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH | |
| - name: Install Anchor | |
| if: steps.check.outputs.has_anchor == 'true' | |
| run: | | |
| cargo install --git https://github.com/coral-xyz/anchor avm --locked --force | |
| avm install 0.30.1 | |
| avm use 0.30.1 | |
| - name: Build Anchor Program | |
| if: steps.check.outputs.has_anchor == 'true' | |
| working-directory: contracts | |
| run: anchor build | |
| # ==================== RUST (General) ==================== | |
| rust-lint: | |
| name: Rust Lint (Clippy) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Check for Cargo.toml | |
| id: check | |
| run: | | |
| if [ -f "contracts/Cargo.toml" ] || [ -f "Cargo.toml" ]; then | |
| echo "has_rust=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "has_rust=false" >> $GITHUB_OUTPUT | |
| echo "::notice::No Cargo.toml found - skipping Rust lint" | |
| fi | |
| - name: Install Rust | |
| if: steps.check.outputs.has_rust == 'true' | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: ${{ env.RUST_VERSION }} | |
| components: clippy, rustfmt | |
| - name: Run Clippy | |
| if: steps.check.outputs.has_rust == 'true' | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| continue-on-error: true | |
| - name: Check Formatting | |
| if: steps.check.outputs.has_rust == 'true' | |
| run: cargo fmt -- --check | |
| continue-on-error: true | |
| # ==================== SUMMARY ==================== | |
| ci-status: | |
| name: CI Status Summary | |
| runs-on: ubuntu-latest | |
| needs: [backend-lint, backend-tests, frontend-lint, frontend-typecheck, frontend-tests, frontend-build, contracts-check, rust-lint] | |
| if: always() | |
| steps: | |
| - name: Check CI Results | |
| run: | | |
| echo "## CI Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "| Job | Status |" >> $GITHUB_STEP_SUMMARY | |
| echo "|-----|--------|" >> $GITHUB_STEP_SUMMARY | |
| echo "| Backend Lint | ${{ needs.backend-lint.result }} |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Backend Tests | ${{ needs.backend-tests.result }} |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Frontend Lint | ${{ needs.frontend-lint.result }} |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Frontend Type Check | ${{ needs.frontend-typecheck.result }} |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Frontend Tests | ${{ needs.frontend-tests.result }} |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Frontend Build | ${{ needs.frontend-build.result }} |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Contracts Check | ${{ needs.contracts-check.result }} |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Rust Lint | ${{ needs.rust-lint.result }} |" >> $GITHUB_STEP_SUMMARY | |
| - name: Fail if any job failed | |
| if: contains(needs.*.result, 'failure') | |
| run: exit 1 |