From 18a9381705e17d38ccb561f267c151ab8c5cd2c7 Mon Sep 17 00:00:00 2001 From: Ethan Smith Date: Thu, 2 May 2024 08:29:31 -0400 Subject: [PATCH] ci: move check-node-version to separate step The installed version of NPM shouldn't impact tests. It only matters when installing deps. --- .github/workflows/ci.yml | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51bb8ff..dc5bea0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ jobs: node-version-file: '.nvmrc' - run: npm i -g npm@10.5.0 - run: npm ci + - run: npm run check-node-version - run: npm run standards test: needs: [ build ] @@ -31,8 +32,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - - run: npm i -g npm@10.5.0 - - run: npm ci # Reinstall the dependencies to ensure they install with the current version of node + - run: npm ci # Reinstall the dependencies to ensure they install with the node's version of npm - run: npm test - name: Coveralls uses: coverallsapp/github-action@v1 diff --git a/package.json b/package.json index 7029656..3f566dd 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "module": "./dist/esm/index", "scripts": { "prepare": "grunt build", - "test:node-version": "check-node-version --npm 10.5.0 --print", - "test": "npm run test:node-version && TS_NODE_PROJECT='tests/tsconfig.json' TS_NODE_FILES=true nyc mocha --opts ./.mocha.opts", + "check-node-version": "check-node-version --npm 10.5.0 --print", + "test": "TS_NODE_PROJECT='tests/tsconfig.json' TS_NODE_FILES=true nyc mocha --opts ./.mocha.opts", "eslint": "eslint '{,!(node_modules|dist)/**/}*.{js,ts}'", "markdownlint": "markdownlint -c .markdownlint.json -i CHANGELOG.md '{,!(node_modules)/**/}*.md'", "commitlint": "commitlint --from 0b9d320",