Skip to content

Commit

Permalink
fix(ci): wrong ‘node' and ‘deploy' workflows
Browse files Browse the repository at this point in the history
Error:
- In the `node` workflow, the `npm ci` command needs the `package-lock.json` file to work, but this file is removed before running `npm install` with the npm `preinstall` script.
- In the `node` workflow, the version 16 check does not work because the `console.log` is not allowed by eslint in the `EditorJson.vue` file.

Solution:
- Update the `preinstall` npm script to make it faster.
- In the `node` workflow, use the `npm install` command instead of `npm ci`, this command auto runs the npm `preinstall` script which already does a clean install, removing the `node_modules` folder and the `package-lock.json` file.
- Disables the `no-console` slint rule in the `EditorJson.vue` file.

Resolutions:
- https://stackoverflow.com/a/68095189/10855837
- https://stackoverflow.com/a/53325242/10855837
- rogeriochaves/npm-force-resolutions#17
- https://www.npmjs.com/package/force-resolutions
  • Loading branch information
beatrizsmerino committed Jul 5, 2022
1 parent 625a904 commit 9991b8d
Show file tree
Hide file tree
Showing 5 changed files with 34,923 additions and 16,412 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Setup Node.js for use with actions
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x

- name: Checkout branch
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [14.x, 16.x, 18.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm install
- run: npm run build --if-present
- run: npm test --if-present
Loading

0 comments on commit 9991b8d

Please sign in to comment.