diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be8b1b6..ea815ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,16 +10,14 @@ jobs: test-unit: name: Lint & Unit Tests (TypeScript) runs-on: ubuntu-latest - strategy: - matrix: - node-version: [20.x] steps: - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} + # Version comes from .nvmrc so `nvm use` locally and CI cannot drift. + - name: Use Node.js from .nvmrc uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version-file: '.nvmrc' cache: 'npm' - name: Install dependencies @@ -64,16 +62,13 @@ jobs: name: End-to-End Integration Tests runs-on: ubuntu-latest needs: test-unit - strategy: - matrix: - node-version: [20.x] steps: - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js from .nvmrc uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version-file: '.nvmrc' cache: 'npm' - name: Install dependencies diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..209e3ef --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6fbde38..f298311 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -96,7 +96,9 @@ new package rather than being bolted onto an existing one — open an issue to d ## Code style -- TypeScript, Node 20+. Formatting is enforced by Prettier/ESLint (`npm run lint`). +- TypeScript, Node 20+. The exact version CI uses is pinned in `.nvmrc` — run + `nvm use` in the repo root to match it. Formatting is enforced by + Prettier/ESLint (`npm run lint`). - Prefer small, focused functions and explicit types on exported APIs. - Don't vendor `compliance-primitives` contract code here — reference it as a dependency/link.