Skip to content

Commit bb91980

Browse files
authored
chore: use github actions (#97)
* chore: use github actions * add * remove type * add test * add test
1 parent abde933 commit bb91980

File tree

10 files changed

+406
-36
lines changed

10 files changed

+406
-36
lines changed
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
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+
36+
- name: cache node_modules
37+
id: node_modules_cache_id
38+
uses: actions/cache@v2
39+
with:
40+
path: node_modules
41+
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
42+
43+
- name: install
44+
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
45+
run: npm ci
46+
47+
lint:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: checkout
51+
uses: actions/checkout@master
52+
53+
- name: restore cache from package-lock.json
54+
uses: actions/cache@v2
55+
with:
56+
path: package-temp-dir
57+
key: lock-${{ github.sha }}
58+
59+
- name: restore cache from node_modules
60+
uses: actions/cache@v2
61+
with:
62+
path: node_modules
63+
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
64+
65+
- name: lint
66+
run: npm run lint
67+
68+
needs: setup
69+
70+
compile:
71+
runs-on: ubuntu-latest
72+
steps:
73+
- name: checkout
74+
uses: actions/checkout@master
75+
76+
- name: restore cache from package-lock.json
77+
uses: actions/cache@v2
78+
with:
79+
path: package-temp-dir
80+
key: lock-${{ github.sha }}
81+
82+
- name: restore cache from node_modules
83+
uses: actions/cache@v2
84+
with:
85+
path: node_modules
86+
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
87+
88+
- name: compile
89+
run: npm run compile
90+
91+
needs: setup
92+
93+
coverage:
94+
runs-on: ubuntu-latest
95+
steps:
96+
- name: checkout
97+
uses: actions/checkout@master
98+
99+
- name: restore cache from package-lock.json
100+
uses: actions/cache@v2
101+
with:
102+
path: package-temp-dir
103+
key: lock-${{ github.sha }}
104+
105+
- name: restore cache from node_modules
106+
uses: actions/cache@v2
107+
with:
108+
path: node_modules
109+
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
110+
111+
- name: coverage
112+
run: npm test -- --coverage && bash <(curl -s https://codecov.io/bash)
113+
114+
needs: setup

.travis.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Progress Bar.
44

55
[![NPM version][npm-image]][npm-url]
6-
[![build status][travis-image]][travis-url]
6+
[![build status][github-actions-image]][github-actions-url]
77
[![Test coverage][coveralls-image]][coveralls-url]
88
[![Dependencies][david-image]](david-url)
99
[![DevDependencies][david-dev-image]][david-dev-url]
@@ -12,8 +12,8 @@ Progress Bar.
1212

1313
[npm-image]: http://img.shields.io/npm/v/rc-progress.svg?style=flat-square
1414
[npm-url]: http://npmjs.org/package/rc-progress
15-
[travis-image]: https://img.shields.io/travis/react-component/progress/master?style=flat-square
16-
[travis-url]: https://travis-ci.org/react-component/progress
15+
[github-actions-image]: https://github.com/react-component/progress/workflows/CI/badge.svg
16+
[github-actions-url]: https://github.com/react-component/progress/actions
1717
[circleci-image]: https://img.shields.io/circleci/react-component/progress/master?style=flat-square
1818
[circleci-url]: https://circleci.com/gh/react-component/progress
1919
[coveralls-image]: https://img.shields.io/coveralls/react-component/progress.svg?style=flat-square

src/Circle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import classNames from 'classnames';
33
import { useTransitionDuration, defaultProps } from './common';
4-
import type { ProgressProps, GapPositionType } from './interface';
4+
import { ProgressProps, GapPositionType } from './interface';
55

66
let gradientSeed = 0;
77

src/Line.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import classNames from 'classnames';
33
import { useTransitionDuration, defaultProps } from './common';
4-
import type { ProgressProps } from './interface';
4+
import { ProgressProps } from './interface';
55

66
const Line: React.FC<ProgressProps> = ({
77
className,

src/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useRef, useEffect } from 'react';
2-
import type { ProgressProps } from './interface';
2+
import { ProgressProps } from './interface';
33

44
export const defaultProps: Partial<ProgressProps> = {
55
className: '',

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Line from './Line';
22
import Circle from './Circle';
3-
import type { ProgressProps } from './interface';
3+
import { ProgressProps } from './interface';
44

55
export { Line, Circle, ProgressProps };
66

src/interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type * as React from 'react';
1+
import * as React from 'react';
22

33
export interface ProgressProps {
44
strokeWidth?: number;

0 commit comments

Comments
 (0)