forked from react-recompose/react-recompose
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (76 loc) · 3.79 KB
/
min-dist-build-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# based on:
# - .github/workflows/dist-build-test.yml
# - .github/workflows/ci-test-node.js.yml
# - https://github.com/actions/starter-workflows/blob/b2e786d4e9af21f57ab07c1bc7231ed867f7675f/ci/node.js.yml
name: min dist build test
# FUTURE TODO refactor some of the steps into script(s) that
# can be run from either the command line or GitHub CI.
on:
- push
- pull_request
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version:
- 16.x
- 18.x
os:
- ubuntu-latest
- macos-latest
# FOR FUTURE CONSIDERATION:
# - windows-latest
defaults:
run:
working-directory: build
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- run: yarn build:recompose
- name: add (--dev) required dependencies
# FUTURE TODO should install dependencies as specified src/packages/recompose/package.json
run: yarn add --dev @babel/runtime change-emitter hoist-non-react-statics react-lifecycles-compat
- name: copy lib/packages/recompose/dist from root /lib
run: |
mkdir -p lib/packages/recompose
cp -r ../lib/packages/recompose/dist lib/packages/recompose/
- name: copy __tests__ from src/packages/recompose
run: cp -r src/packages/recompose/__tests__ lib/packages/recompose/dist
- name: copy js files needed for some tests # FUTURE TODO only copy js files **actually** needed here
run: |
cp src/packages/recompose/*.js lib/packages/recompose/dist
cp -r src/packages/recompose/utils lib/packages/recompose/dist
- name: remove tests not working with Recompose.min.js # TBD (TODO) find a better solution
run: |
rm lib/packages/recompose/dist/__tests__/withHandlers-test.js
rm lib/packages/recompose/dist/__tests__/mapPropsStream-test.js
rm lib/packages/recompose/dist/__tests__/withStateHandlers-test.js
rm lib/packages/recompose/dist/__tests__/withState-test.js
rm lib/packages/recompose/dist/__tests__/pure-test.js
rm lib/packages/recompose/dist/__tests__/mapPropsStreamWithConfig-test.js
rm lib/packages/recompose/dist/__tests__/onlyUpdateForPropTypes-test.js
rm lib/packages/recompose/dist/__tests__/withReducer-test.js
rm lib/packages/recompose/dist/__tests__/withPropsOnChange-test.js
rm lib/packages/recompose/dist/__tests__/branch-test.js
rm lib/packages/recompose/dist/__tests__/shouldUpdate-test.js
rm lib/packages/recompose/dist/__tests__/lifecycle-test.js
rm lib/packages/recompose/dist/__tests__/onlyUpdateForKeys-test.js
rm lib/packages/recompose/dist/__tests__/renameProps-test.js
rm lib/packages/recompose/dist/__tests__/withContext-test.js
rm lib/packages/recompose/dist/__tests__/fromRenderProps-test.js
rm lib/packages/recompose/dist/__tests__/defaultProps-test.js
rm lib/packages/recompose/dist/__tests__/mapProps-test.js
rm lib/packages/recompose/dist/__tests__/renderNothing-test.js
rm lib/packages/recompose/dist/__tests__/renameProp-test.js
rm lib/packages/recompose/dist/__tests__/withProps-test.js
rm lib/packages/recompose/dist/__tests__/flattenProp-test.js
rm lib/packages/recompose/dist/__tests__/nest-test.js
rm lib/packages/recompose/dist/__tests__/toRenderProps-test.js
- run: cp lib/packages/recompose/dist/Recompose.min.js lib/packages/recompose/dist/index.js
- run: yarn jest lib/packages/recompose/dist