Consolidate CI workflows - #282
Conversation
bickelj
left a comment
There was a problem hiding this comment.
This looks good, though I think your commit message is a bit weird, it has double-newlines instead of single newlines. Also there is a missing newline at the end of ci.yml.
There was a problem hiding this comment.
Pull request overview
This PR consolidates previously separate CI workflows into a single GitHub Actions workflow (ci.yml) with multiple jobs, aligning CI structure with other repositories.
Changes:
- Replaces
lint.yml,check-types.yml, andtest.ymlwith a unified.github/workflows/ci.ymlcontaining separate jobs for linting, type-checking, building, and testing. - Adds workflow self-linting (
actionlint) and a lockfile sync check (npm-install). - Introduces workflow-level
permissions: contents: readand PR-cancelingconcurrencyconfiguration.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| .github/workflows/ci.yml | New consolidated CI workflow with multiple jobs (actionlint, lockfile check, linting, type-checking, build, tests), plus permissions and concurrency. |
| .github/workflows/lint.yml | Removed in favor of consolidated ci.yml. |
| .github/workflows/check-types.yml | Removed in favor of consolidated ci.yml. |
| .github/workflows/test.yml | Removed in favor of consolidated ci.yml. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a14eaf9 to
e8eaf86
Compare
|
Thanks for the review @bickelj and @Copilot — pushed an update (
@Copilot
Ready for another look. — GLM-5.2 |
Our other PDC repositories use a single consolidated CI workflow file, which keeps CI checks distinct from other workflows we may add. The previous lint, check-types, and test workflows each ran a single job; this combines them as jobs in one ci.yml, adds an actionlint job and a lockfile-sync check, enables npm caching on the Node jobs, and cancels superseded runs on PRs. Prior behavior is preserved: the build job compiles tsconfig.json (the former check-types command) and the tsc job adds dev/test type-checking. Mirrors PhilanthropyDataCommons/http-status-codes#24
e8eaf86 to
5aa2949
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (2)
.github/workflows/ci.yml:55
- The PR description says the consolidated workflow contains jobs
eslint,tsc, andtestplus two new jobs (actionlint,npm-install), but this file also introducesprettierandbuild. If these jobs are intentional, the PR description should be updated; if not, consider removing them to match the stated scope.
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .node-version
cache: npm
- run: npm ci
- run: npm run lint:prettier
.github/workflows/ci.yml:6
pushis currently limited tomain(branches: [main]), which is a behavior change from the removedlint.yml/check-types.yml/test.ymlworkflows that ran on pushes to any branch. If you still want CI on non-PR feature-branch pushes, drop the branch filter (or broaden it).
This issue also appears on line 45 of the same file.
push:
branches: [main]
pull_request:
|
Copilot's second review left two suppressed comments (in the review summary rather than as inline threads). Both have merit — addressing them here. 1. PR description under-listed the jobs (ci.yml:55). Valid. My description said the old workflows "each ran a single job" and listed only 2. — GLM-5.2 |
This PR consolidates our CI steps into a single
ci.ymlfile, aligning with our other repositories.The three previous CI workflows are consolidated into jobs in one
ci.yml:lint.ymlrannpm run lint(lint:eslint && lint:prettier && lint:tsc) → split into theeslint,prettier, andtscjobscheck-types.ymlrantsc -p tsconfig.json(thebuildscript) → thebuildjobtest.ymlrannpm test→ thetestjobTwo new jobs are added:
actionlint— lints the workflow YAML itselfnpm-install— fails ifpackage-lock.jsonis out of syncSo
ci.ymlcontains seven jobs:actionlint,npm-install,eslint,prettier,tsc,build,test.The workflow also gains a top-level
permissions: contents: readand aconcurrencyblock that cancels superseded runs on PRs (but not onmain), and enablescache: npmon every Node job.Behavior change — push trigger scope: the old workflows ran on pushes to any branch (
on: pushwith no branch filter). The consolidatedci.ymlrunspushonly onmain(and on everypull_request), matching the convention in our other repositories (e.g. http-status-codes#24). This avoids duplicate CI runs when a feature branch has an open PR (thepull_requestrun covers it) while still running CI on direct pushes tomain. The trade-off is that a bare push to a feature branch with no PR no longer triggers CI. If you'd rather keep CI on every feature-branch push, thebranches: [main]filter can be dropped — say the word and I'll remove it.add-to-project.ymlis intentionally left as its own workflow since it is not a CI check.Mirrors PhilanthropyDataCommons/http-status-codes#24.