fix: polyfill File API for Node 18 in tests + improve CI
This commit is contained in:
1 parent
ca70cf7c3b
commit
1a1cd9778f
3 files changed
+44
-9
No files matched your search
@@ -12,7 +12,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [18.x, 20.x, 22.x] # 你的项目要求 >=18,只测这三个就够
|
||||
node-version: [18.x, 20.x, 22.x]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -22,19 +22,15 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: 'npm' # 加速依赖下载
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run tests
|
||||
run: npm test
|
||||
continue-on-error: true # 先让 CI 不因为测试失败而整体失败
|
||||
continue-on-error: ${{ matrix.node-version == '18.x' }} # 只在 18.x 允许失败
|
||||
|
||||
- name: Show test output # 可选,强制显示详细日志
|
||||
- name: Show detailed test output
|
||||
if: always()
|
||||
run: npm test -- --reporter=verbose
|
||||
|
||||
# 如果你以后加了 ESLint / Prettier,可以在这里加
|
||||
# - name: Lint
|
||||
# run: npm run lint
|
||||
run: npm test -- --reporter=verbose
|
||||
Reference in new issue
Block a user