Skip to content

Commit 83c2ce4

Browse files
authored
chore: use CircleCI workflows [WIP] (#3993)
* chore: use CircleCI workflows * remove orb * add workflow * fix path
1 parent 488bbee commit 83c2ce4

1 file changed

Lines changed: 71 additions & 35 deletions

File tree

.circleci/config.yml

Lines changed: 71 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,90 @@
1-
version: 2
1+
version: 2.1
2+
23
general:
34
branches:
45
ignore:
56
- gh-pages
7+
8+
docker_defaults: &docker_defaults
9+
docker:
10+
- image: circleci/node:12-browsers
11+
working_directory: ~/project/semantic-ui-react
12+
13+
restore_node_modules: &restore_node_modules
14+
restore_cache:
15+
name: Restore node_modules cache
16+
keys:
17+
- v3-node-{{ .Branch }}-{{ checksum "yarn.lock" }}
18+
- v3-node-{{ .Branch }}-
19+
- v3-node-
20+
621
jobs:
7-
build:
8-
docker:
9-
- image: circleci/node:8-browsers
10-
environment:
11-
TZ: "/usr/share/zoneinfo/America/Los_Angeles"
22+
bootstrap:
23+
<<: *docker_defaults
1224
steps:
13-
- run:
14-
name: Update yarn
15-
command: |
16-
# remove default yarn
17-
sudo rm -rf $(dirname $(which yarn))/yarn*
18-
# download latest
19-
rm -rf ~/.yarn
20-
curl -o- -L https://yarnpkg.com/install.sh | bash
21-
echo 'export PATH="${PATH}:${HOME}/.yarn/bin"' >> $BASH_ENV
2225
- checkout
23-
# because we don't invoke npm (we use yarn) we need to add npm bin to PATH manually
24-
- run:
25-
name: Add npm bin to PATH
26-
command: echo 'export PATH="${PATH}:$(npm bin)"' >> $BASH_ENV
27-
- restore_cache:
28-
keys:
29-
- v2-dependencies-{{ checksum "yarn.lock" }}
26+
- *restore_node_modules
3027
- run:
3128
name: Install Dependencies
32-
command: yarn
29+
command: yarn install --frozen-lockfile
3330
- save_cache:
34-
key: v2-dependencies-{{ checksum "yarn.lock" }}
31+
name: Save yarn cache
32+
key: v3-yarn-{{ .Branch }}-{{ checksum "yarn.lock" }}
3533
paths:
36-
- ~/.cache/yarn
37-
- run:
38-
name: Lint TypeScript
39-
command: yarn tsd:lint
40-
- run:
41-
name: Test TypeScript
42-
command: yarn tsd:test
34+
- .cache/yarn
35+
- save_cache:
36+
name: Save node_modules cache
37+
key: v3-node-{{ .Branch }}-{{ checksum "yarn.lock" }}
38+
paths:
39+
- node_modules/
4340
- run:
44-
name: Lint JavaScript
45-
command: yarn lint
41+
name: Remove node_modules to cleanup workspace
42+
command: rm -r node_modules/
43+
- persist_to_workspace:
44+
root: ~/project
45+
paths:
46+
- semantic-ui-react
47+
48+
test:
49+
<<: *docker_defaults
50+
steps:
51+
- attach_workspace:
52+
at: ~/project
53+
- *restore_node_modules
4654
- run:
4755
name: Test JavaScript
4856
command: yarn test
57+
- run:
58+
name: Report coverage
59+
command: bash <(curl -s https://codecov.io/bash)
60+
- run:
61+
name: Test TypeScript
62+
command: yarn tsd:test
4963
- run:
5064
name: Test UMD bundle
5165
command: yarn test:umd
66+
67+
lint:
68+
<<: *docker_defaults
69+
steps:
70+
- attach_workspace:
71+
at: ~/project
72+
- *restore_node_modules
5273
- run:
53-
name: Report coverage
54-
command: bash <(curl -s https://codecov.io/bash)
74+
name: Lint TypeScript
75+
command: yarn tsd:lint
76+
- run:
77+
name: Lint JavaScript
78+
command: yarn lint
79+
80+
workflows:
81+
version: 2
82+
main:
83+
jobs:
84+
- bootstrap
85+
- test:
86+
requires:
87+
- bootstrap
88+
- lint:
89+
requires:
90+
- bootstrap

0 commit comments

Comments
 (0)