Skip to content

Commit

Permalink
ci: use package-lock.json file to enable consistent CI runs
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensby committed Jul 24, 2024
1 parent e1523b7 commit e092cb2
Show file tree
Hide file tree
Showing 6 changed files with 6,129 additions and 16 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/tests-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 20
# install to create local package-lock.json but don't cache the files
# also: no audit for dev dependencies
- run: npm i --package-lock-only && npm audit --production
- run: npm clean-install && npm audit --production

# STEP 2 - basic unit tests

Expand All @@ -50,7 +48,7 @@ jobs:
node-version: ${{ matrix.node }}
cache: npm
# for this workflow we also require npm audit to pass
- run: npm i
- run: npm clean-install
- run: npm run test:coverage

# with the following action we enforce PRs to have a high coverage
Expand Down Expand Up @@ -97,7 +95,7 @@ jobs:
# xxx: added bluebird as explicit dependency
- run: |
cd github/testing/express
npm i
npm install
npm install https://github.com/node-oauth/node-oauth2-server.git#${{ github.ref_name }}
npm run test
Expand All @@ -112,7 +110,7 @@ jobs:
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm i
- run: npm clean-install
- run: npm publish --dry-run
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
Expand All @@ -130,7 +128,7 @@ jobs:
# we always publish targeting the lowest supported node version
node-version: 16
registry-url: $registry-url(npm)
- run: npm i
- run: npm clean-install
- run: npm publish --dry-run
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
node-version: 20
cache: npm
- run: npm install
- run: npm clean-install
- run: npm run lint

unittest:
Expand All @@ -44,7 +44,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm i
- run: npm clean-install
- run: npm run test:coverage

# with the following action we enforce PRs to have a high coverage
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,3 @@ tramp
# coverage
coverage
.nyc_output

package-lock.json
yarn.lock
3 changes: 0 additions & 3 deletions .npmignore

This file was deleted.

1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

Loading

0 comments on commit e092cb2

Please sign in to comment.