UNPKG

1.82 kBYAMLView Raw
1before_script:
2- pwd
3- which nodejs
4- nodejs -v
5- which npm
6- npm -v
7- which yarn
8- yarn --version
9- yarn config set cache-folder .yarn
10
11cache:
12 key: "${CI_BUILD_REF_NAME}_${CI_RUNNER_TAGS}"
13 paths:
14 - node_modules/
15 - .yarn/
16
17# jobs sequense pipeline
18stages:
19- test
20- build
21
22# test job: test project use yarn
23.test_template: &test_definition
24 script:
25 - yarn install
26 - yarn lint
27 stage: test
28
29test_node_10:
30 <<: *test_definition
31 tags:
32 - node-10
33
34test_node_12:
35 <<: *test_definition
36 tags:
37 - node-12
38
39test_node_14:
40 <<: *test_definition
41 tags:
42 - node-14
43
44test_node_16:
45 <<: *test_definition
46 tags:
47 - node-16
48
49# build job: Use react-starter to create the react project
50.build_template: &build_definition
51 script:
52 - yarn install
53 - npm link
54 - which react-starter
55 - react-starter --version
56 - react-starter -n test
57 - cd test && yarn && npm run lint && npm test && npm run build
58 stage: build
59
60build_node_10:
61 <<: *build_definition
62 tags:
63 - node-10
64
65build_node_12:
66 <<: *build_definition
67 tags:
68 - node-12
69
70build_node_14:
71 <<: *build_definition
72 tags:
73 - node-14
74
75build_node_16:
76 <<: *build_definition
77 tags:
78 - node-16
79
80# build job: Use react-starter to create the simple react project
81.build_typescript_template: &build_typescript_definition
82 script:
83 - yarn install
84 - npm link
85 - which react-starter
86 - react-starter --version
87 - react-starter -n test -t
88 - cd test && yarn && npm run lint && npm test && npm run build
89 stage: build
90
91build_typescript_node_10:
92 <<: *build_typescript_definition
93 tags:
94 - node-10
95
96build_typescript_node_12:
97 <<: *build_typescript_definition
98 tags:
99 - node-12
100
101build_typescript_node_14:
102 <<: *build_typescript_definition
103 tags:
104 - node-14
105
106build_typescript_node_16:
107 <<: *build_typescript_definition
108 tags:
109 - node-16