UNPKG

3.83 kBYAMLView Raw
1common: &common
2 machine: true
3 working_directory: ~/build-tools
4
5test_steps: &test_steps
6 <<: *common
7 steps:
8 - checkout
9 - run:
10 name: set node keys
11 command: |
12 echo "node ${NODE_VERSION}"
13 echo ${NODE_VERSION} > .node-version
14 - restore_cache:
15 key: dependency-cache-{{ checksum "package.json" }}-{{ checksum ".node-version" }}
16 - restore_cache:
17 key: yarn-cache-{{ checksum "package.json" }}-{{ checksum ".node-version" }}
18 - restore_cache:
19 key: dont-break-cache-v1-{{ checksum ".node-version" }}
20 - run:
21 name: initial-steps
22 command: |
23 ./scripts/ci/upgrade-node.sh
24 ./scripts/ci/upgrade-yarn.sh
25 - run:
26 name: pre-deps
27 command: |
28 sudo chmod -R a+w /usr/local
29 yarn config set cache-folder ~/.cache/yarn
30 if [ "${NPM_TOKEN}" == "" ]; then rm .npmrc; fi
31 - run:
32 name: install-deps
33 command: |
34 npm run setup
35 if [ "${NPM_TOKEN}" != "" ]; then
36 ./scripts/install-dont-break.sh
37 cp -f .npmrc ~
38 yarn global add --ignore-engines "@egis/egis-ui-test-utils@^2.28.1-pre.1"
39 update-chrome
40 fi
41 - save_cache:
42 key: dependency-cache-{{ checksum "package.json" }}-{{ checksum ".node-version" }}
43 paths:
44 - node_modules
45 - yarn.lock
46 - run:
47 name: post-deps
48 command: |
49 mkdir ci-artifacts
50 OUT_DIR=ci-artifacts ./scripts/ci/collect-deps-versions.sh
51 cp yarn.lock ci-artifacts/
52 when: always
53 - store_artifacts:
54 path: ci-artifacts/
55 - run:
56 name: test
57 environment:
58 KEEP_MODIFIED_PACKAGE: true
59 command: |
60 npm test
61 ./scripts/merge-build-tools-deps.js && git checkout -- package.json
62 if [ "${NPM_TOKEN}" != "" ]; then
63 dont-break --timeout 600
64 fi
65 - run:
66 name: test-global-scripts
67 command: |
68 npm rm --global @egis/build-tools || true
69 npm install -g .
70 merge-build-tools-deps && echo > .success && git checkout -- package.json
71 if [ ! -e .success ]; then exit 1; fi
72 - save_cache:
73 key: yarn-cache-{{ checksum "package.json" }}-{{ checksum ".node-version" }}
74 paths:
75 - ~/.cache/yarn
76 - save_cache:
77 key: dont-break-cache-v1-{{ checksum ".node-version" }}
78 paths:
79 - /tmp/egis-build-tools-v-0-0-0-semantic-release-against-egis-egis-ui
80 - /tmp/egis-build-tools-v-0-0-0-semantic-release-against-egis-esign
81 - /tmp/egis-build-tools-v-0-0-0-semantic-release-against-egis-portal-app
82 - /tmp/egis-build-tools-v-0-0-0-semantic-release-against-egis-bulk-capture
83
84version: 2
85jobs:
86 test8:
87 environment:
88 NODE_VERSION: 8.10.0
89 <<: *test_steps
90 test6:
91 environment:
92 NODE_VERSION: 6.0.0
93 <<: *test_steps
94 publish:
95 <<: *common
96 environment:
97 NODE_VERSION: 8.10.0
98 steps:
99 - checkout
100 - run:
101 name: set node keys
102 command: echo ${NODE_VERSION} > .node-version
103 - restore_cache:
104 key: dependency-cache-{{ checksum "package.json" }}-{{ checksum ".node-version" }}
105 - restore_cache:
106 key: yarn-cache-{{ checksum "package.json" }}-{{ checksum ".node-version" }}
107 - run:
108 name: set node version
109 command: ./scripts/ci/upgrade-node.sh
110 - run:
111 name: publish
112 command: SEMANTIC_DEPENDENTS_UPDATES=true ./scripts/semantic-release.sh
113
114
115workflows:
116 version: 2
117 main:
118 jobs:
119 - test8
120 - test6
121 - publish:
122 filters:
123 branches:
124 only: master
125 requires:
126 - test6
127 - test8