Skip to content

Commit 0edb273

Browse files
committed
优化IdentifierPool - 世代式ID池管理器
1 parent e1bc364 commit 0edb273

File tree

16 files changed

+5594
-260
lines changed

16 files changed

+5594
-260
lines changed

.github/workflows/ci.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, main, develop ]
6+
pull_request:
7+
branches: [ master, main, develop ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x, 22.x]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
with:
21+
submodules: recursive
22+
23+
- name: Setup Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
cache: 'npm'
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: Run tests with coverage
33+
run: npm run test:ci
34+
35+
- name: Upload coverage to Codecov
36+
if: matrix.node-version == '20.x'
37+
uses: codecov/codecov-action@v4
38+
with:
39+
file: ./coverage/lcov.info
40+
flags: unittests
41+
name: codecov-umbrella
42+
fail_ci_if_error: false
43+
44+
build:
45+
runs-on: ubuntu-latest
46+
needs: test
47+
48+
steps:
49+
- name: Checkout code
50+
uses: actions/checkout@v4
51+
with:
52+
submodules: recursive
53+
54+
- name: Setup Node.js
55+
uses: actions/setup-node@v4
56+
with:
57+
node-version: '20.x'
58+
cache: 'npm'
59+
60+
- name: Install dependencies
61+
run: npm ci
62+
63+
- name: Build project
64+
run: npm run build
65+
66+
- name: Build npm package
67+
run: npm run build:npm
68+
69+
- name: Upload build artifacts
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: build-artifacts
73+
path: |
74+
bin/
75+
dist/
76+
retention-days: 7

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# ECS Framework
22

3+
[![CI](https://github.com/esengine/ecs-framework/workflows/CI/badge.svg)](https://github.com/esengine/ecs-framework/actions)
34
[![npm version](https://badge.fury.io/js/%40esengine%2Fecs-framework.svg)](https://badge.fury.io/js/%40esengine%2Fecs-framework)
45
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
56

Submodule utilityai_designer deleted from 045748f

extensions/cocos/cocos-ecs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
"@esengine/ecs-framework": "^2.1.23",
1717
"@esengine/mvvm-ui-framework": "^1.0.5"
1818
}
19-
}
19+
}

jest.config.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
2+
module.exports = {
3+
preset: 'ts-jest',
4+
testEnvironment: 'node',
5+
roots: ['<rootDir>/tests', '<rootDir>/src'],
6+
testMatch: ['**/*.test.ts', '**/*.spec.ts'],
7+
collectCoverage: false,
8+
collectCoverageFrom: [
9+
'src/**/*.ts',
10+
'!src/index.ts',
11+
'!src/**/index.ts',
12+
'!**/*.d.ts',
13+
'!src/**/*.test.ts',
14+
'!src/**/*.spec.ts'
15+
],
16+
coverageDirectory: 'coverage',
17+
coverageReporters: ['text', 'lcov', 'html'],
18+
verbose: true,
19+
transform: {
20+
'^.+\\.tsx?$': ['ts-jest', {
21+
tsconfig: 'tsconfig.test.json',
22+
}],
23+
},
24+
moduleNameMapper: {
25+
'^@/(.*)$': '<rootDir>/src/$1',
26+
},
27+
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
28+
// 测试超时设置
29+
testTimeout: 10000,
30+
// 清除模块缓存
31+
clearMocks: true,
32+
restoreMocks: true,
33+
// 忽略某些模块
34+
modulePathIgnorePatterns: [
35+
'<rootDir>/bin/',
36+
'<rootDir>/dist/',
37+
'<rootDir>/node_modules/'
38+
]
39+
};

0 commit comments

Comments
 (0)