Skip to content

Commit 6be0e14

Browse files
authored
test: use unified github action yml (#738)
1 parent 9d57cb8 commit 6be0e14

File tree

8 files changed

+12
-122
lines changed

8 files changed

+12
-122
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,6 @@
1-
name: CI
2-
3-
on: ['push', 'pull_request']
4-
1+
name: ✅ test
2+
on: [push, pull_request]
53
jobs:
6-
setup:
7-
runs-on: ubuntu-latest
8-
steps:
9-
- name: checkout
10-
uses: actions/checkout@v4
11-
12-
- uses: actions/setup-node@v4
13-
with:
14-
node-version: '20'
15-
16-
- name: cache package-lock.json
17-
uses: actions/cache@v4
18-
with:
19-
path: package-temp-dir
20-
key: lock-${{ github.sha }}
21-
22-
- name: create package-lock.json
23-
run: npm i --package-lock-only --ignore-scripts
24-
25-
- name: hack for singe file
26-
run: |
27-
if [ ! -d "package-temp-dir" ]; then
28-
mkdir package-temp-dir
29-
fi
30-
cp package-lock.json package-temp-dir
31-
32-
- name: cache node_modules
33-
id: node_modules_cache_id
34-
uses: actions/cache@v4
35-
with:
36-
path: node_modules
37-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
38-
39-
- name: install
40-
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
41-
run: npm ci
42-
43-
lint:
44-
runs-on: ubuntu-latest
45-
steps:
46-
- name: checkout
47-
uses: actions/checkout@v4
48-
49-
- name: restore cache from package-lock.json
50-
uses: actions/cache@v4
51-
with:
52-
path: package-temp-dir
53-
key: lock-${{ github.sha }}
54-
55-
- name: restore cache from node_modules
56-
uses: actions/cache@v4
57-
with:
58-
path: node_modules
59-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
60-
61-
- name: lint
62-
run: npm run lint
63-
64-
needs: setup
65-
66-
compile:
67-
runs-on: ubuntu-latest
68-
steps:
69-
- name: checkout
70-
uses: actions/checkout@v4
71-
72-
- name: restore cache from package-lock.json
73-
uses: actions/cache@v4
74-
with:
75-
path: package-temp-dir
76-
key: lock-${{ github.sha }}
77-
78-
- name: restore cache from node_modules
79-
uses: actions/cache@v4
80-
with:
81-
path: node_modules
82-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
83-
84-
- name: compile
85-
run: npm run compile
86-
87-
needs: setup
88-
89-
coverage:
90-
runs-on: ubuntu-latest
91-
steps:
92-
- name: checkout
93-
uses: actions/checkout@v4
94-
95-
- name: restore cache from package-lock.json
96-
uses: actions/cache@v4
97-
with:
98-
path: package-temp-dir
99-
key: lock-${{ github.sha }}
100-
101-
- name: restore cache from node_modules
102-
uses: actions/cache@v4
103-
with:
104-
path: node_modules
105-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
106-
107-
- name: coverage
108-
run: npm test -- --coverage
109-
110-
- name: Upload coverage to Codecov
111-
uses: codecov/codecov-action@v4
112-
with:
113-
token: ${{ secrets.CODECOV_TOKEN }}
114-
115-
needs: setup
4+
test:
5+
uses: react-component/rc-test/.github/workflows/test.yml@main
6+
secrets: inherit

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@ pnpm-lock.yaml
3838
.umi-production
3939
.umi-test
4040
.env.local
41-
.dumi
41+
.dumi
42+
43+
bun.lockb

docs/examples/dynamic-extra.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export default () => {
3030
onChange={(curKey) => setKey(curKey)}
3131
tabBarExtraContent={extra}
3232
defaultActiveKey="8"
33-
moreIcon="..."
3433
items={items}
3534
/>
3635
</div>

docs/examples/editable.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default () => {
77
const [tabs, setTabs] = React.useState(
88
new Array(countRef.current).fill(0).map((_, index) => {
99
return {
10-
key: index,
10+
key: `${index}`,
1111
content: `tab content ${index + 1}`,
1212
};
1313
}),
@@ -25,7 +25,7 @@ export default () => {
2525
return [
2626
...lastTabs,
2727
{
28-
key: ++countRef.current,
28+
key: `${++countRef.current}`,
2929
content: `tab content ${countRef.current}`,
3030
},
3131
];
@@ -40,7 +40,6 @@ export default () => {
4040
<Tabs
4141
editable={editable}
4242
defaultActiveKey="8"
43-
moreIcon="..."
4443
items={tabs.map(({ key, content }) => ({
4544
key,
4645
label: `tab ${key}`,

docs/examples/extra.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export default () => {
104104

105105
return (
106106
<div style={{ maxWidth: 550 }}>
107-
<Tabs tabBarExtraContent={extra} defaultActiveKey="8" moreIcon="..." items={items} />
107+
<Tabs tabBarExtraContent={extra} defaultActiveKey="8" items={items} />
108108
<div style={{ display: 'flex' }}>
109109
<div>
110110
<input

docs/examples/mix.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ export default () => {
163163
tabBarGutter={gutter ? 32 : null}
164164
tabBarExtraContent="extra"
165165
defaultActiveKey="30"
166-
moreIcon="..."
167166
// moreTransitionName="233"
168167
style={{ height: fixHeight ? 300 : null }}
169168
items={tabPanes}

docs/examples/overflow.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export default () => {
2525
tabBarGutter={gutter ? 32 : null}
2626
tabBarExtraContent="extra"
2727
defaultActiveKey="8"
28-
moreIcon="..."
2928
items={items}
3029
/>
3130
</div>

docs/examples/renderTabBar-dragable.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ class DraggableTabs extends React.Component<TabsProps> {
111111
});
112112

113113
return (
114+
// @ts-ignore https://github.com/react-dnd/react-dnd/issues/3636 需要升级 15.0.0 类型支持 children 但是写法需要重新调整验证
114115
<DndProvider backend={HTML5Backend}>
115116
<Tabs renderTabBar={this.renderTabBar} {...this.props} items={orderTabs} />
116117
</DndProvider>

0 commit comments

Comments
 (0)