1 | before_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 |
|
11 | cache:
|
12 | key: "${CI_BUILD_REF_NAME}_${CI_RUNNER_TAGS}"
|
13 | paths:
|
14 | - node_modules/
|
15 | - .yarn/
|
16 |
|
17 |
|
18 | stages:
|
19 | - test
|
20 | - build
|
21 |
|
22 |
|
23 | .test_template: &test_definition
|
24 | script:
|
25 | - yarn install
|
26 | - yarn lint
|
27 | stage: test
|
28 |
|
29 | test_node_14:
|
30 | <<: *test_definition
|
31 | tags:
|
32 | - node-14
|
33 |
|
34 | test_node_16:
|
35 | <<: *test_definition
|
36 | tags:
|
37 | - node-16
|
38 |
|
39 |
|
40 | .build_template: &build_definition
|
41 | script:
|
42 | - yarn install
|
43 | - npm link
|
44 | - which react-starter
|
45 | - react-starter --version
|
46 | - react-starter -n test
|
47 | - cd test && yarn && npm run lint && npm test && npm run build
|
48 | stage: build
|
49 |
|
50 | build_node_14:
|
51 | <<: *build_definition
|
52 | tags:
|
53 | - node-14
|
54 |
|
55 | build_node_16:
|
56 | <<: *build_definition
|
57 | tags:
|
58 | - node-16
|
59 |
|
60 |
|
61 | .build_typescript_template: &build_typescript_definition
|
62 | script:
|
63 | - yarn install
|
64 | - npm link
|
65 | - which react-starter
|
66 | - react-starter --version
|
67 | - react-starter -n test -t
|
68 | - cd test && yarn && npm run lint && npm test && npm run build
|
69 | stage: build
|
70 |
|
71 | build_typescript_node_14:
|
72 | <<: *build_typescript_definition
|
73 | tags:
|
74 | - node-14
|
75 |
|
76 | build_typescript_node_16:
|
77 | <<: *build_typescript_definition
|
78 | tags:
|
79 | - node-16
|