Skip to content

Commit d4f2af8

Browse files
committed
test message
1 parent 6fc5a5f commit d4f2af8

File tree

2 files changed

+156
-156
lines changed

2 files changed

+156
-156
lines changed

.github/workflows/dependency-updates.yml

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -23,53 +23,53 @@ on:
2323
jobs:
2424
update-dependencies:
2525
runs-on: ubuntu-latest
26-
26+
2727
steps:
28-
- name: Checkout
29-
uses: actions/checkout@v4
30-
with:
31-
token: ${{ secrets.GITHUB_TOKEN }}
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
with:
31+
token: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Setup Node.js
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: '20'
37+
cache: 'yarn'
38+
39+
- name: Install dependencies
40+
run: yarn install --frozen-lockfile
41+
42+
- name: Check for outdated dependencies
43+
run: yarn outdated || true
44+
45+
- name: Update dependencies
46+
run: |
47+
yarn upgrade-interactive --latest
48+
yarn install
49+
continue-on-error: true
50+
51+
- name: Run tests after updates
52+
run: yarn test
53+
54+
- name: Create Pull Request
55+
uses: peter-evans/create-pull-request@v5
56+
with:
57+
token: ${{ secrets.GITHUB_TOKEN }}
58+
commit-message: 'chore(deps): update dependencies'
59+
title: 'chore(deps): update dependencies'
60+
body: |
61+
## 🤖 Automated Dependency Updates
62+
63+
This PR updates dependencies to their latest versions.
64+
65+
### Changes:
66+
- Updated development dependencies
67+
- Updated production dependencies
68+
69+
### Testing:
70+
- ✅ All tests pass
71+
- ✅ Build successful
3272
33-
- name: Setup Node.js
34-
uses: actions/setup-node@v4
35-
with:
36-
node-version: '20'
37-
cache: 'yarn'
38-
39-
- name: Install dependencies
40-
run: yarn install --frozen-lockfile
41-
42-
- name: Check for outdated dependencies
43-
run: yarn outdated || true
44-
45-
- name: Update dependencies
46-
run: |
47-
yarn upgrade-interactive --latest
48-
yarn install
49-
continue-on-error: true
50-
51-
- name: Run tests after updates
52-
run: yarn test
53-
54-
- name: Create Pull Request
55-
uses: peter-evans/create-pull-request@v5
56-
with:
57-
token: ${{ secrets.GITHUB_TOKEN }}
58-
commit-message: 'chore(deps): update dependencies'
59-
title: 'chore(deps): update dependencies'
60-
body: |
61-
## 🤖 Automated Dependency Updates
62-
63-
This PR updates dependencies to their latest versions.
64-
65-
### Changes:
66-
- Updated development dependencies
67-
- Updated production dependencies
68-
69-
### Testing:
70-
- ✅ All tests pass
71-
- ✅ Build successful
72-
73-
Please review the changes and merge if everything looks good.
74-
branch: chore/update-dependencies
75-
delete-branch: true
73+
Please review the changes and merge if everything looks good.
74+
branch: chore/update-dependencies
75+
delete-branch: true

.github/workflows/performance.yml

Lines changed: 108 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -16,118 +16,118 @@ name: Performance Testing
1616

1717
on:
1818
push:
19-
branches: [ main, master ]
19+
branches: [main, master]
2020
pull_request:
21-
branches: [ main, master ]
21+
branches: [main, master]
2222
workflow_dispatch: # Allow manual trigger
2323

2424
jobs:
2525
benchmark:
2626
runs-on: ubuntu-latest
27-
27+
2828
steps:
29-
- name: Checkout
30-
uses: actions/checkout@v4
31-
32-
- name: Setup Node.js
33-
uses: actions/setup-node@v4
34-
with:
35-
node-version: '20'
36-
cache: 'yarn'
37-
38-
- name: Install dependencies
39-
run: yarn install --frozen-lockfile
40-
41-
- name: Build project
42-
run: yarn build
43-
44-
- name: Run performance benchmarks
45-
run: |
46-
echo "Running wcwidth performance tests..."
47-
node -e "
48-
const { wcwidth } = require('./dist/index.js');
49-
const iterations = 1000000;
50-
const start = performance.now();
51-
52-
for (let i = 0; i < iterations; i++) {
53-
wcwidth(65); // 'A'
54-
wcwidth(0x4E00); // '一'
55-
wcwidth(0); // null
56-
}
57-
58-
const end = performance.now();
59-
const avgTime = (end - start) / iterations;
60-
console.log(\`wcwidth: \${avgTime.toFixed(6)}ms per call\`);
61-
console.log(\`Total time: \${(end - start).toFixed(2)}ms for \${iterations} calls\`);
62-
"
63-
64-
- name: Run wcswidth performance tests
65-
run: |
66-
echo "Running wcswidth performance tests..."
67-
node -e "
68-
const { wcswidth } = require('./dist/index.js');
69-
const testStrings = [
70-
'Hello World',
71-
'Hello 世界',
72-
'A'.repeat(1000),
73-
'一'.repeat(100),
74-
'Hello\u0000World'
75-
];
76-
77-
const iterations = 10000;
78-
const start = performance.now();
79-
80-
for (let i = 0; i < iterations; i++) {
81-
testStrings.forEach(str => wcswidth(str));
82-
}
83-
84-
const end = performance.now();
85-
const avgTime = (end - start) / (iterations * testStrings.length);
86-
console.log(\`wcswidth: \${avgTime.toFixed(6)}ms per call\`);
87-
console.log(\`Total time: \${(end - start).toFixed(2)}ms for \${iterations * testStrings.length} calls\`);
88-
"
89-
90-
- name: Memory usage test
91-
run: |
92-
echo "Testing memory usage..."
93-
node -e "
94-
const { wcswidth, wcwidth } = require('./dist/index.js');
95-
96-
const initialMemory = process.memoryUsage();
97-
console.log('Initial memory:', initialMemory);
98-
99-
// Perform intensive operations
100-
for (let i = 0; i < 100000; i++) {
101-
wcswidth('Hello World ' + i);
102-
wcwidth(i % 65536);
103-
}
104-
105-
const finalMemory = process.memoryUsage();
106-
console.log('Final memory:', finalMemory);
107-
108-
const memoryIncrease = {
109-
heapUsed: finalMemory.heapUsed - initialMemory.heapUsed,
110-
heapTotal: finalMemory.heapTotal - initialMemory.heapTotal,
111-
external: finalMemory.external - initialMemory.external
112-
};
113-
114-
console.log('Memory increase:', memoryIncrease);
115-
"
116-
117-
- name: Bundle size check
118-
run: |
119-
echo "Checking bundle size..."
120-
du -h dist/index.js
121-
echo "Number of lines in dist:"
122-
find dist -name "*.js" -exec wc -l {} \;
123-
124-
- name: Performance regression check
125-
run: |
126-
echo "Checking for performance regressions..."
127-
# This would typically compare against baseline metrics
128-
# For now, we'll just log the current performance
129-
echo "Performance metrics logged above"
130-
echo "Consider setting up performance monitoring with tools like:"
131-
echo "- GitHub Actions performance tracking"
132-
echo "- Bundle size monitoring"
133-
echo "- Runtime performance baselines"
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Setup Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: '20'
36+
cache: 'yarn'
37+
38+
- name: Install dependencies
39+
run: yarn install --frozen-lockfile
40+
41+
- name: Build project
42+
run: yarn build
43+
44+
- name: Run performance benchmarks
45+
run: |
46+
echo "Running wcwidth performance tests..."
47+
node -e "
48+
const { wcwidth } = require('./dist/index.js');
49+
const iterations = 1000000;
50+
const start = performance.now();
51+
52+
for (let i = 0; i < iterations; i++) {
53+
wcwidth(65); // 'A'
54+
wcwidth(0x4E00); // '一'
55+
wcwidth(0); // null
56+
}
57+
58+
const end = performance.now();
59+
const avgTime = (end - start) / iterations;
60+
console.log(\`wcwidth: \${avgTime.toFixed(6)}ms per call\`);
61+
console.log(\`Total time: \${(end - start).toFixed(2)}ms for \${iterations} calls\`);
62+
"
63+
64+
- name: Run wcswidth performance tests
65+
run: |
66+
echo "Running wcswidth performance tests..."
67+
node -e "
68+
const { wcswidth } = require('./dist/index.js');
69+
const testStrings = [
70+
'Hello World',
71+
'Hello 世界',
72+
'A'.repeat(1000),
73+
'一'.repeat(100),
74+
'Hello\u0000World'
75+
];
76+
77+
const iterations = 10000;
78+
const start = performance.now();
79+
80+
for (let i = 0; i < iterations; i++) {
81+
testStrings.forEach(str => wcswidth(str));
82+
}
83+
84+
const end = performance.now();
85+
const avgTime = (end - start) / (iterations * testStrings.length);
86+
console.log(\`wcswidth: \${avgTime.toFixed(6)}ms per call\`);
87+
console.log(\`Total time: \${(end - start).toFixed(2)}ms for \${iterations * testStrings.length} calls\`);
88+
"
89+
90+
- name: Memory usage test
91+
run: |
92+
echo "Testing memory usage..."
93+
node -e "
94+
const { wcswidth, wcwidth } = require('./dist/index.js');
95+
96+
const initialMemory = process.memoryUsage();
97+
console.log('Initial memory:', initialMemory);
98+
99+
// Perform intensive operations
100+
for (let i = 0; i < 100000; i++) {
101+
wcswidth('Hello World ' + i);
102+
wcwidth(i % 65536);
103+
}
104+
105+
const finalMemory = process.memoryUsage();
106+
console.log('Final memory:', finalMemory);
107+
108+
const memoryIncrease = {
109+
heapUsed: finalMemory.heapUsed - initialMemory.heapUsed,
110+
heapTotal: finalMemory.heapTotal - initialMemory.heapTotal,
111+
external: finalMemory.external - initialMemory.external
112+
};
113+
114+
console.log('Memory increase:', memoryIncrease);
115+
"
116+
117+
- name: Bundle size check
118+
run: |
119+
echo "Checking bundle size..."
120+
du -h dist/index.js
121+
echo "Number of lines in dist:"
122+
find dist -name "*.js" -exec wc -l {} \;
123+
124+
- name: Performance regression check
125+
run: |
126+
echo "Checking for performance regressions..."
127+
# This would typically compare against baseline metrics
128+
# For now, we'll just log the current performance
129+
echo "Performance metrics logged above"
130+
echo "Consider setting up performance monitoring with tools like:"
131+
echo "- GitHub Actions performance tracking"
132+
echo "- Bundle size monitoring"
133+
echo "- Runtime performance baselines"

0 commit comments

Comments
 (0)