Skip to content

Commit 2c5614e

Browse files
Layouwenafc163
andauthored
test: use codecov/codecov-action (#49)
Co-authored-by: afc163 <afc163@gmail.com>
1 parent 696c89b commit 2c5614e

File tree

2 files changed

+6
-113
lines changed

2 files changed

+6
-113
lines changed

.github/workflows/main.yml

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"@types/react": "^18.0.0",
4545
"@types/react-dom": "^18.0.0",
4646
"@types/warning": "^3.0.0",
47-
"@umijs/fabric": "^3.0.0",
47+
"@umijs/fabric": "^4.0.0",
4848
"cross-env": "^7.0.3",
4949
"dumi": "^2.0.15",
5050
"eslint": "^8.54.0",

0 commit comments

Comments
 (0)