UNPKG

998 BYAMLView Raw
1# Use the docker runner
2image: node:8
3
4before_script:
5- pwd
6- which nodejs
7- nodejs -v
8- which npm
9- npm -v
10- which yarn
11- yarn --version
12- yarn config set cache-folder .yarn
13
14cache:
15 key: "$CI_BUILD_REF_NAME"
16 paths:
17 - node_modules/
18 - .yarn/
19
20# jobs sequense pipeline
21stages:
22- test
23- build
24
25# test job: test project use npm
26test:
27 tags:
28 - node-8
29 script:
30 - yarn install
31 - yarn lint
32 stage: test
33
34
35# build job: Use react-starter to create the react project
36build:
37 tags:
38 - node-8
39 script:
40 - yarn install
41 - npm link
42 - which react-starter
43 - react-starter --version
44 - react-starter -n test
45 - cd test && yarn && npm run lint && npm test && npm run build
46 stage: build
47
48# build job: Use react-starter to create the simple react project
49build_simple:
50 tags:
51 - node-8
52 script:
53 - yarn install
54 - npm link
55 - which react-starter
56 - react-starter --version
57 - react-starter -n test -s
58 - cd test && yarn && npm run lint && npm test && npm run build
59 stage: build