Skip to content

Consolidate CI workflows - #282

Merged
bickelj merged 1 commit into
mainfrom
consolidate-ci
Jul 31, 2026
Merged

Consolidate CI workflows#282
bickelj merged 1 commit into
mainfrom
consolidate-ci

Conversation

@bickelj-agent

@bickelj-agent bickelj-agent commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

This PR consolidates our CI steps into a single ci.yml file, aligning with our other repositories.

The three previous CI workflows are consolidated into jobs in one ci.yml:

  • lint.yml ran npm run lint (lint:eslint && lint:prettier && lint:tsc) → split into the eslint, prettier, and tsc jobs
  • check-types.yml ran tsc -p tsconfig.json (the build script) → the build job
  • test.yml ran npm test → the test job

Two new jobs are added:

  • actionlint — lints the workflow YAML itself
  • npm-install — fails if package-lock.json is out of sync

So ci.yml contains seven jobs: actionlint, npm-install, eslint, prettier, tsc, build, test.

The workflow also gains a top-level permissions: contents: read and a concurrency block that cancels superseded runs on PRs (but not on main), and enables cache: npm on every Node job.

Behavior change — push trigger scope: the old workflows ran on pushes to any branch (on: push with no branch filter). The consolidated ci.yml runs push only on main (and on every pull_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 (the pull_request run covers it) while still running CI on direct pushes to main. 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, the branches: [main] filter can be dropped — say the word and I'll remove it.

add-to-project.yml is intentionally left as its own workflow since it is not a CI check.

Mirrors PhilanthropyDataCommons/http-status-codes#24.

@bickelj bickelj left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and test.yml with a unified .github/workflows/ci.yml containing 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: read and PR-canceling concurrency configuration.

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.

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml
@bickelj-agent

bickelj-agent commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the review @bickelj and @Copilot — pushed an update (5aa2949) addressing the points:

@bickelj

  • Missing newline at end of ci.yml — fixed, the file now ends with a trailing newline.
  • Commit message double-newlines — rewritten as a single wrapped paragraph (single newlines) instead of one -m per line.

@Copilot

  • actionlint sets up Node but never uses npm / contradicts the PR description — dropped the setup-node step from the actionlint job. actionlint doesn't need Node, so this is faster and makes the description's "cache: npm on every Node job" accurate (every remaining Node job has it).
  • Use -- in the git diff invocation — done: git diff --exit-code -- package-lock.json.
  • tsc job uses tsconfig.dev.json instead of tsconfig.json (behavior change) — left as npm run lint:tsc. The prior check-types.yml ran tsc -p tsconfig.json; that exact check is preserved by the build job (npm run build = tsc -p tsconfig.json). The tsc job (tsc --noEmit -p tsconfig.dev.json) is additive: it also type-checks the test files with jest types. Net coverage is strictly greater, with no regression.
  • build job doesn't validate emit because tsconfig.json has noEmit: true — the premise doesn't hold here: tsconfig.json does not set noEmit (it sets outDir: dist and declaration: true), so npm run build genuinely compiles/emits to dist/ (the committed dist/ is that output). The build job is a real compile check, not redundant with tsc.

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and test plus two new jobs (actionlint, npm-install), but this file also introduces prettier and build. 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

  • push is currently limited to main (branches: [main]), which is a behavior change from the removed lint.yml / check-types.yml / test.yml workflows 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:

@bickelj-agent

Copy link
Copy Markdown
Collaborator Author

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 eslint, tsc, test, omitting prettier and build. In fact lint.yml ran npm run lint = lint:eslint && lint:prettier && lint:tsc (three checks), and check-types.yml ran tsc -p tsconfig.json (the build script). I've updated the PR description to map the old workflows to all seven jobs (actionlint, npm-install, eslint, prettier, tsc, build, test). The prettier and build jobs are intentional — no code change, just a corrected description.

2. push: branches: [main] is a behavior change (ci.yml:6). Valid observation — the old lint.yml / check-types.yml / test.yml ran on pushes to any branch. I'm keeping branches: [main] deliberately: it matches the convention in our other repositories (the explicit goal of this PR, e.g. http-status-codes#24), and pull_request already covers feature branches, so branches: [main] avoids duplicate CI runs when a feature branch has an open PR while still running CI on direct pushes to main. The trade-off is that a bare push to a feature branch with no open PR no longer triggers CI. If you'd prefer to preserve the old "run on every push" behavior, I can drop the branches: [main] filter — let me know.

— GLM-5.2

@bickelj
bickelj merged commit 2766cc3 into main Jul 31, 2026
8 checks passed
@bickelj
bickelj deleted the consolidate-ci branch July 31, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants