-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconfig.yml
More file actions
74 lines (71 loc) · 2.71 KB
/
config.yml
File metadata and controls
74 lines (71 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
version: 2.1
orbs:
welcome: circleci/welcome-orb@0.4.1
jobs:
build:
working_directory: ~/repo
docker:
- image: circleci/node:erbium
steps:
- checkout
- run:
name: 'Update NPM'
command: sudo npm install -g npm@6.13.4
- run:
name: 'Update Yarn'
command: yarn policies set-version 1.22.4
- run:
name: 'Set caching variables'
command: |
LAST_SUCCESSFUL_BUILD_URL="https://circleci.com/api/v1.1/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/tree/dev?filter=successful&limit=1"
LAST_SUCCESSFUL_COMMIT=`curl -Ss -u "$CIRCLE_TOKEN:" $LAST_SUCCESSFUL_BUILD_URL | jq -r '.[0]["vcs_revision"]'`
echo $LAST_SUCCESSFUL_COMMIT > /tmp/last-successful-commit
echo $CIRCLE_SHA1 > /tmp/current-commit
- restore_cache:
keys:
- build-cache-{{ .Branch }}-{{ checksum "/tmp/last-successful-commit" }}
- build-cache-dev-{{ checksum "/tmp/last-successful-commit" }}
- run:
name: 'Install Dependencies'
command: yarn install
- run:
name: 'Build Packages'
command: yarn build
- save_cache:
key: repo-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo
- save_cache:
key: build-cache-{{ .Branch }}-{{ checksum "/tmp/current-commit" }}
paths:
- ~/repo/packages/contract-artifacts/node_modules
- ~/repo/packages/contract-artifacts/lib
- ~/repo/packages/contracts/node_modules
- ~/repo/packages/dev-utils/node_modules
- ~/repo/packages/react-app/node_modules
- ~/repo/packages/subgraph/node_modules
test:
working_directory: ~/repo
docker:
- image: circleci/node:erbium
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: 'Test Packages'
command: yarn test
workflows:
version: 2
main:
jobs:
- build:
filters:
branches:
ignore: gh-pages
- test:
requires:
- build
filters:
branches:
ignore: gh-pages