Skip to content

clementrog/github-workflows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

github-workflows

Shared, reusable GitHub Actions workflows for clementrog's Node/TypeScript repos.

node-pr-ci.yml — PR CI contract

A reusable workflow (workflow_call) that runs PR checks. The contract is standardized; the command is not.

Every caller repo must expose an npm run ci:pr script. This workflow only does:

npm ci
npm run ci:pr

Each repo decides what ci:pr means (typecheck + its own meaningful test subset). Don't hard-code one universal test command across repos — that's fake safety.

Use it

Add .github/workflows/pr-ci.yml to a repo:

name: PR CI
on:
  pull_request:
    branches: [main]
jobs:
  ci:
    uses: clementrog/github-workflows/.github/workflows/node-pr-ci.yml@v1
    with:
      node-version: "20.19.0"   # optional; default 20.19.0

Then define the contract in that repo's package.json:

{
  "scripts": {
    "ci:typecheck": "tsc --noEmit",
    "ci:test:focused": "vitest --run",
    "ci:pr": "npm run ci:typecheck && npm run ci:test:focused"
  }
}

The resulting check appears as ci / ci (caller job → reusable job). Make it required on main after it has run green at least once. Avoid paths: filters on a required check — skipped required checks leave PRs stuck pending.

Inputs

input default description
node-version 20.19.0 passed to actions/setup-node
runs-on ubuntu-latest runner label

Versioning

Pin callers to a tag (@v1) or SHA rather than @main, so a change to the recipe can't silently alter every repo's CI at once.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors