-
Notifications
You must be signed in to change notification settings - Fork 0
Scaffold reusable DevEx workflows, release pipeline, and onboarding docs #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
363a6bf
dd1d1db
722865f
1a7e7cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| quality: | ||
| uses: ./.github/workflows/reusable-quality.yml | ||
| with: | ||
| setup-node: false | ||
| run-format-check: false | ||
| run-lint: false | ||
| run-test: false | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
Comment on lines
+9
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The workflow grants Useful? React with 👍 / 👎. |
||
|
|
||
| jobs: | ||
| release-please: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Release Please | ||
| uses: googleapis/release-please-action@v4 | ||
| with: | ||
| release-type: simple | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Switching Useful? React with 👍 / 👎. |
||
| changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Maintenance","hidden":false}]' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| name: Reusable Quality Checks | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| checkout-fetch-depth: | ||
| description: Git checkout fetch depth. | ||
| required: false | ||
| default: 0 | ||
| type: number | ||
| setup-node: | ||
| description: Enable Node.js setup. | ||
| required: false | ||
| default: true | ||
| type: boolean | ||
| node-version: | ||
| description: Node.js version for JS/TS projects. | ||
| required: false | ||
| default: '20' | ||
| type: string | ||
| run-format-check: | ||
| description: Run formatting validation command. | ||
| required: false | ||
| default: true | ||
| type: boolean | ||
| format-command: | ||
| description: Command used for format validation. | ||
| required: false | ||
| default: npm run format:check --if-present | ||
| type: string | ||
| run-lint: | ||
| description: Run lint command. | ||
| required: false | ||
| default: true | ||
| type: boolean | ||
| lint-command: | ||
| description: Command used for lint validation. | ||
| required: false | ||
| default: npm run lint --if-present | ||
| type: string | ||
| run-test: | ||
| description: Run automated tests. | ||
| required: false | ||
| default: true | ||
| type: boolean | ||
| test-command: | ||
| description: Command used to run test suite. | ||
| required: false | ||
| default: npm test --if-present | ||
| type: string | ||
|
|
||
| jobs: | ||
| quality: | ||
| name: Quality | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: ${{ inputs.checkout-fetch-depth }} | ||
|
|
||
| - name: Set up Node.js | ||
| if: ${{ inputs.setup-node }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ inputs.node-version }} | ||
| cache: npm | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The reusable workflow always sets Useful? React with 👍 / 👎. |
||
|
|
||
| - name: Install dependencies | ||
| if: ${{ inputs.setup-node }} | ||
| run: npm ci | ||
|
Comment on lines
+70
to
+72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The reusable workflow hard-codes Useful? React with 👍 / 👎. |
||
|
|
||
| - name: Format check | ||
| if: ${{ inputs.run-format-check }} | ||
| run: ${{ inputs.format-command }} | ||
|
|
||
| - name: Lint | ||
| if: ${{ inputs.run-lint }} | ||
| run: ${{ inputs.lint-command }} | ||
|
|
||
| - name: Test | ||
| if: ${{ inputs.run-test }} | ||
| run: ${{ inputs.test-command }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| # Developer Setup | ||
|
|
||
| This guide provides generic onboarding defaults intended for template-based repositories. | ||
|
|
||
| ## 1) Prerequisites | ||
|
|
||
| - Git 2.40+ | ||
| - A language runtime/toolchain for your project (Node, Python, Go, etc.) | ||
| - A package manager (`npm`, `pnpm`, `pip`, `poetry`, `go`, etc.) | ||
|
|
||
| ## 2) Bootstrap locally | ||
|
|
||
| ```bash | ||
| git clone <your-repo-url> | ||
| cd <your-repo> | ||
| ./scripts/bootstrap.sh | ||
| ``` | ||
|
|
||
| If your repository is not Node.js based, adapt `scripts/bootstrap.sh` to your stack and keep command names consistent with CI. | ||
|
|
||
| ## 3) Recommended task contract | ||
|
|
||
| To keep automation portable, define task commands with predictable names: | ||
|
|
||
| - `format:check` — formatting validation | ||
| - `lint` — static analysis/linting | ||
| - `test` — automated tests | ||
|
|
||
| This template's reusable workflow can call any shell command, but these names improve discoverability. | ||
|
|
||
| ## 4) CI customization | ||
|
|
||
| The repository ships with: | ||
|
|
||
| - `.github/workflows/reusable-quality.yml` (reusable workflow) | ||
| - `.github/workflows/ci.yml` (default entry workflow) | ||
| - `.github/workflows/release.yml` (semantic release PR/tag automation) | ||
|
|
||
| In `ci.yml`, enable checks by setting: | ||
|
|
||
| - `setup-node: true` for JS/TS projects | ||
| - `run-format-check: true` | ||
| - `run-lint: true` | ||
| - `run-test: true` | ||
|
|
||
| Then optionally override commands: | ||
|
|
||
| ```yaml | ||
| with: | ||
| setup-node: true | ||
| format-command: npm run format:check | ||
| lint-command: npm run lint | ||
| test-command: npm test | ||
| ``` | ||
|
|
||
| ## 5) Branch and PR workflow | ||
|
|
||
| 1. Create a branch from `main`. | ||
| 2. Run local validation commands before opening a PR. | ||
| 3. Open a focused PR and include context for reviewers. | ||
| 4. Merge only when CI checks pass. | ||
|
|
||
| ## 6) Lightweight automation standards | ||
|
|
||
| - Keep workflows minimal and composable. | ||
| - Prefer reusable workflows (`workflow_call`) over duplicated YAML. | ||
| - Avoid stack-specific assumptions in template defaults. | ||
| - Keep commands configurable through workflow inputs. | ||
| - Fail fast in CI and keep logs clear. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| if [[ ! -f package.json ]]; then | ||
| echo "No package.json found. This bootstrap script is currently oriented to Node.js projects." | ||
| echo "Copy and adapt scripts/bootstrap.sh for your stack (Python, Go, Rust, etc.)." | ||
| exit 0 | ||
| fi | ||
|
|
||
| if command -v npm >/dev/null 2>&1; then | ||
| npm ci | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The bootstrap script unconditionally runs Useful? React with 👍 / 👎.
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @codex rebase this branch onto the latest main and resolve all merge conflicts. Requirements:
Workflow: git fetch origin resolve conflictsgit add . After completion, summarize:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Summary
Requested post-rebase report
Testing
If you provide a repo state with |
||
| echo "Dependencies installed." | ||
| else | ||
| echo "npm is not installed. Please install Node.js 20+ and retry." | ||
| exit 1 | ||
| fi | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This CI entrypoint disables every validation input (
setup-node,run-format-check,run-lint, andrun-testare allfalse), so on bothpull_requestandpushevents the requiredqualitycheck can pass after only checkout with no quality signal. That creates false-green protection status and allows regressions to merge unnoticed unless every consumer manually edits the workflow first.Useful? React with 👍 / 👎.