|
| 1 | +# Workflow and CI conventions |
| 2 | + |
| 3 | +## Standard triggers |
| 4 | + |
| 5 | +The default standard callers use: |
| 6 | + |
| 7 | +```yaml |
| 8 | +push: |
| 9 | + branches: [main, staging] |
| 10 | +pull_request: |
| 11 | + branches: [staging] |
| 12 | +``` |
| 13 | +
|
| 14 | +Draft PR automation may additionally listen to supported topic branches. |
| 15 | +Custom deployment, indexing, search, Slither, or other workflows are |
| 16 | +repository-owned extensions and should keep their own triggers and permissions. |
| 17 | +
|
| 18 | +## Standard workflow responsibilities |
| 19 | +
|
| 20 | +| Workflow | Responsibility | |
| 21 | +| --- | --- | |
| 22 | +| CI | Format, lint, type-check, and build | |
| 23 | +| Test | Unit, integration, E2E, and smoke tests | |
| 24 | +| Security | Profile, audits, and public-only Dependency Review | |
| 25 | +| CodeQL | GitHub-native code scanning, kept separate from CI | |
| 26 | +| Draft PR | Create/update development pull requests | |
| 27 | +| Release PR | Promote `staging` into `main` | |
| 28 | +| Release | Release Please, GitHub release, and optional npm publication | |
| 29 | + |
| 30 | +Use concise job names such as `CI / Format`, `Test / Unit`, and |
| 31 | +`CodeQL / Analyze (Python)`. Required checks should match the jobs actually |
| 32 | +enabled for the repository profile. |
| 33 | + |
| 34 | +## Language defaults |
| 35 | + |
| 36 | +- TypeScript/JavaScript: ESLint, Prettier, and Bun's native `bun test`. |
| 37 | +- Rust: default `rustfmt`, Clippy with `-D warnings`, and Cargo tests. |
| 38 | +- Python: Ruff formatting/linting, uv when a compatible lockfile exists, and |
| 39 | + native Python tests. |
| 40 | +- Solidity: preserve the repository's native Hardhat, Foundry, or specialized |
| 41 | + test/security workflows. |
| 42 | + |
| 43 | +Jobs detect applicability before installing tools. Empty language or test |
| 44 | +surfaces remain successful and visible, so branch protection does not become |
| 45 | +ambiguous for mixed-language repositories. |
| 46 | + |
| 47 | +## Security behavior |
| 48 | + |
| 49 | +CodeQL is a separate workflow using GitHub's official actions. Dependency |
| 50 | +Review is skipped where GitHub does not support it, while JavaScript, Python, |
| 51 | +and Rust audits remain available without Advanced Security. If GitHub default |
| 52 | +setup is enabled, disable its generated CodeQL workflow to avoid duplicate |
| 53 | +analysis. |
| 54 | + |
| 55 | +## Branch protection |
| 56 | + |
| 57 | +Use the initializer's protection helper after reviewing the repository's |
| 58 | +enabled features: |
| 59 | + |
| 60 | +```bash |
| 61 | +bash .github/scripts/init-repo.sh --protection |
| 62 | +``` |
| 63 | + |
| 64 | +Keep strict status checks, linear history, and conversation resolution enabled. |
| 65 | +For a repository with optional features disabled, do not require checks that |
| 66 | +will never run. |
0 commit comments