在本地,运行tsc
或tsc -w
并行于npm t -- --watch
所有工作,但尝试将我所拥有的内容复制到 Github CI 并没有奏效。由于某种原因,我什至无法使用ls
. 不过,TypeScript 和 Jest 的安装似乎都成功了。
当它在 Github CItsc
中运行时,我只是从右下方收到所有可能命令的日志Run tsc
和一个Error: Process completed with exit code 1.
.
这是我在 Github CI 中的当前设置:
...
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Installing TypeScript
run: npm i -D typescript
- name: Installing Jest
run: npm i -D jest
- name: Compiling TypeScript Code
run: tsc
- name: Running Tests
run: npm t
这是我的package.json
:
{
...
"main": "dist/content.js",
"scripts": {
"test": "jest",
"testwatch": "jest --watchAll"
},
"devDependencies": {
"@types/jest": "^26.0.15",
"jest": "^26.6.2",
"ts-jest": "^26.4.3",
"typescript": "^4.0.5"
}
}
我认为与我相关的唯一事情tsconfig.json
是:
{
"outDir": "./dist/",
"rootDir": "./lib/",
}
我在这个设置中犯了错误吗?我错过了什么?这是我的项目的完整设置。