mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
editor/code: Break down CI steps to know what is failing easily
To do this change, we reorganize npm-script. | previous | after | |--------------------|----------------------------------------| | `npm run lint` | `npm run lint && npm run format:check` | | `npm run fix` | `npm run lint:fix && npm run format` | The previous `npm run fix` sometimes does not complete fix automatically because ESLint's autofix doees not follow prettier's formatting. So we need to run `npm run lint:fix && npm run format` by this order.
This commit is contained in:
parent
c7ce8add14
commit
5cca093fa8
15
.github/workflows/ci.yaml
vendored
15
.github/workflows/ci.yaml
vendored
@ -161,10 +161,21 @@ jobs:
|
|||||||
# if: runner.os == 'Linux'
|
# if: runner.os == 'Linux'
|
||||||
# working-directory: ./editors/code
|
# working-directory: ./editors/code
|
||||||
|
|
||||||
|
# If this steps fails, your code's type integrity might be wrong at some places at TypeScript level.
|
||||||
|
- run: npm run typecheck
|
||||||
|
working-directory: ./editors/code
|
||||||
|
if: needs.changes.outputs.typescript == 'true'
|
||||||
|
|
||||||
|
# You may fix the code automatically by running `npm run lint:fix` if this steps fails.
|
||||||
- run: npm run lint
|
- run: npm run lint
|
||||||
working-directory: ./editors/code
|
working-directory: ./editors/code
|
||||||
if: needs.changes.outputs.typescript == 'true'
|
if: needs.changes.outputs.typescript == 'true'
|
||||||
|
|
||||||
|
# To fix this steps, please run `npm run format`.
|
||||||
|
- run: npm run format:check
|
||||||
|
working-directory: ./editors/code
|
||||||
|
if: needs.changes.outputs.typescript == 'true'
|
||||||
|
|
||||||
- name: Run VS Code tests (Linux)
|
- name: Run VS Code tests (Linux)
|
||||||
if: matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
|
if: matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
|
||||||
env:
|
env:
|
||||||
@ -179,10 +190,6 @@ jobs:
|
|||||||
run: npm test
|
run: npm test
|
||||||
working-directory: ./editors/code
|
working-directory: ./editors/code
|
||||||
|
|
||||||
- run: npm run pretest
|
|
||||||
working-directory: ./editors/code
|
|
||||||
if: needs.changes.outputs.typescript == 'true'
|
|
||||||
|
|
||||||
- run: npm run package --scripts-prepend-node-path
|
- run: npm run package --scripts-prepend-node-path
|
||||||
working-directory: ./editors/code
|
working-directory: ./editors/code
|
||||||
if: needs.changes.outputs.typescript == 'true'
|
if: needs.changes.outputs.typescript == 'true'
|
||||||
|
@ -35,9 +35,12 @@
|
|||||||
"build-base": "esbuild ./src/main.ts --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node --target=node16",
|
"build-base": "esbuild ./src/main.ts --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node --target=node16",
|
||||||
"build": "npm run build-base -- --sourcemap",
|
"build": "npm run build-base -- --sourcemap",
|
||||||
"watch": "npm run build-base -- --sourcemap --watch",
|
"watch": "npm run build-base -- --sourcemap --watch",
|
||||||
"lint": "prettier --check . && eslint -c .eslintrc.js --ext ts ./src ./tests",
|
"format": "prettier --write .",
|
||||||
"fix": "prettier --write . && eslint -c .eslintrc.js --ext ts ./src ./tests --fix",
|
"format:check": "prettier --check .",
|
||||||
"pretest": "tsc && npm run build",
|
"lint": "eslint -c .eslintrc.js --ext ts ./src ./tests",
|
||||||
|
"lint:fix": "npm run lint -- --fix",
|
||||||
|
"typecheck": "tsc",
|
||||||
|
"pretest": "npm run typecheck && npm run build",
|
||||||
"test": "node ./out/tests/runTests.js"
|
"test": "node ./out/tests/runTests.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
Loading…
Reference in New Issue
Block a user