Skip to content

Commit 4a1b31e

Browse files
committed
Use GitHub workflows for CI
Close #1845 Fix #1841
1 parent e03ac45 commit 4a1b31e

File tree

7 files changed

+69
-27
lines changed

7 files changed

+69
-27
lines changed

.github/workflows/compressed-size.yml renamed to .github/workflows/performance.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
name: compressed-size
1+
name: performance
2+
23
on: [pull_request]
4+
35
jobs:
4-
build:
6+
compressed-size:
57
runs-on: ubuntu-latest
68
steps:
79
- uses: actions/checkout@v2

.github/workflows/test.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
jobs:
11+
format:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-node@v1
16+
with:
17+
node-version: '14.x'
18+
- run: npm install -g yarn
19+
- run: yarn install
20+
- run: yarn fmt:report
21+
22+
type-check:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v2
26+
- uses: actions/setup-node@v1
27+
with:
28+
node-version: '14.x'
29+
- run: npm install -g yarn
30+
- run: yarn install
31+
- run: yarn flow
32+
33+
lint:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v2
37+
- uses: actions/setup-node@v1
38+
with:
39+
node-version: '14.x'
40+
- run: npm install -g yarn
41+
- run: yarn install
42+
- run: yarn lint:report
43+
44+
unit-test:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v2
48+
- uses: actions/setup-node@v1
49+
with:
50+
node-version: '14.x'
51+
- run: npm install -g yarn
52+
- run: yarn install
53+
- run: yarn jest

.travis.yml

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ MIT license.
208208

209209
[package-badge]: https://img.shields.io/npm/v/react-native-web.svg?style=flat
210210
[package-url]: https://yarnpkg.com/en/package/react-native-web
211-
[ci-badge]: https://travis-ci.org/necolas/react-native-web.svg?branch=master
212-
[ci-url]: https://travis-ci.org/necolas/react-native-web
211+
[ci-badge]: https://github.com/necolas/react-native-web/workflows/test/badge.svg
212+
[ci-url]: https://github.com/necolas/react-native-web/actions
213213
[react-native-url]: https://facebook.github.io/react-native/
214214
[contributing-url]: https://github.com/necolas/react-native-web/blob/master/.github/CONTRIBUTING.md
215215
[good-first-issue-url]: https://github.com/necolas/react-native-web/labels/good%20first%20issue

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
"docs:release": "cd packages/docs && yarn release",
1414
"flow": "flow",
1515
"fmt": "prettier --write \"**/*.js\"",
16+
"fmt:report": "prettier --check \"**/*.js\"",
1617
"jest": "jest --config ./scripts/jest/config.js",
17-
"lint": "yarn lint:check --fix",
18-
"lint:check": "eslint packages scripts",
18+
"lint": "yarn lint:report --fix",
19+
"lint:report": "eslint packages scripts",
1920
"precommit": "lint-staged",
2021
"prerelease": "yarn test && yarn compile && yarn compile:commonjs",
2122
"release": "node ./scripts/release/publish.js",
2223
"postrelease": "yarn benchmarks:release && yarn docs:release",
23-
"test": "yarn flow && yarn lint:check && yarn jest --runInBand"
24+
"test": "yarn flow && yarn lint:report && yarn jest --runInBand"
2425
},
2526
"devDependencies": {
2627
"@babel/cli": "^7.8.4",

packages/react-native-web/src/exports/Modal/__tests__/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,14 @@ describe('components/Modal', () => {
418418

419419
function TestComponent() {
420420
React.useEffect(() => spy('mount'), []);
421-
return <Modal visible={true}><a ref={(ref) => ref ? spy('ref') : spy('noref')} /></Modal>;
421+
return (
422+
<Modal visible={true}>
423+
<a ref={ref => (ref ? spy('ref') : spy('noref'))} />
424+
</Modal>
425+
);
422426
}
423427

424-
render(<TestComponent />)
428+
render(<TestComponent />);
425429

426430
expect(spy).toHaveBeenNthCalledWith(1, 'ref');
427431
expect(spy).toHaveBeenNthCalledWith(2, 'mount');

packages/react-native-web/src/modules/useMergeRefs/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import * as React from 'react';
1111
import mergeRefs from '../mergeRefs';
1212

1313
export default function useMergeRefs(...args: $ReadOnlyArray<React.ElementRef<any>>) {
14-
// TODO(memoize) #1755
1514
return React.useMemo(
1615
() => mergeRefs(...args),
1716
// eslint-disable-next-line

0 commit comments

Comments
 (0)