Use Circleci 2.0
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
Łukasz Magiera committed
Oct 27, 2018 at 16:40 UTC
d756d64071457515c25435eed082121e42705693
2 files changed
+109
-40
.circleci/config.yml
new
+109
@@ -0,0 +1,109 @@
1
+version: 2
2
+
3
+defaults: &defaults
4
+ working_directory: ~/ipfs/go-ipfs
5
+ shell: /bin/bash --login
6
+ environment:
7
+ TEST_NO_FUSE: 1
8
+ GOPATH: $HOME/.go_workspace
9
+ CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
10
+ CIRCLE: 1
11
+ SERVICE: circle-ci
12
+ TEST_NO_DOCKER: 1
13
+ CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
14
+ TEST_VERBOSE: 1
15
+ TRAVIS: 1
16
+ IMPORT_PATH: github.com/ipfs/go-ipfs
17
+
18
+ docker:
19
+ - image: circleci/build-image:ubuntu-14.04-XXL-upstart-1189-5614f37
20
+ command: /sbin/init
21
+
22
+jobs:
23
+ gotest:
24
+ <<: *defaults
25
+ steps:
26
+ - checkout
27
+ - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
28
+ - run: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; '
29
+ - run: sudo rm -rf /usr/local/go
30
+ - run: if [ ! -e go1.11.linux-amd64.tar.gz ]; then curl -o go1.11.linux-amd64.tar.gz https://storage.googleapis.com/golang/go1.11.linux-amd64.tar.gz; fi
31
+ - run: sudo tar -C /usr/local -xzf go1.11.linux-amd64.tar.gz
32
+
33
+ - restore_cache:
34
+ keys:
35
+ - v1-dep-{{ .Branch }}-
36
+ - v1-dep-master-
37
+
38
+ - run: sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 net.ipv6.conf.default.disable_ipv6=0 net.ipv6.conf.all.disable_ipv6=0
39
+ - run: rm -rf "$HOME/.go_workspace/src/$IMPORT_PATH"
40
+ - run: mkdir -p "$HOME/.go_workspace/src/$IMPORT_PATH"
41
+ - run: cp -aT . "$HOME/.go_workspace/src/$IMPORT_PATH"
42
+ - run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && make deps
43
+
44
+ - save_cache:
45
+ key: v1-dep-{{ .Branch }}-{{ epoch }}
46
+ paths:
47
+ - ~/.go_workspace
48
+ - ~/go1.11.linux-amd64.tar.gz
49
+ - ~/.go_workspace/src/gx/ipfs
50
+ - ./node_modules
51
+
52
+
53
+ - run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && curl -s https://codecov.io/bash > codecov
54
+ - run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && make -j 1 coverage/unit_tests.coverprofile
55
+ - run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && bash codecov -cF unittests -X search -f coverage/unit_tests.coverprofile
56
+ - store_test_results:
57
+ path: /tmp/circleci-test-results
58
+ # Save artifacts
59
+ - store_artifacts:
60
+ path: /tmp/circleci-artifacts
61
+ - store_artifacts:
62
+ path: /tmp/circleci-test-results
63
+ sharness:
64
+ <<: *defaults
65
+ steps:
66
+ - checkout
67
+ - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
68
+ - run: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; '
69
+ - run: sudo rm -rf /usr/local/go
70
+ - run: if [ ! -e go1.11.linux-amd64.tar.gz ]; then curl -o go1.11.linux-amd64.tar.gz https://storage.googleapis.com/golang/go1.11.linux-amd64.tar.gz; fi
71
+ - run: sudo tar -C /usr/local -xzf go1.11.linux-amd64.tar.gz
72
+
73
+ - restore_cache:
74
+ keys:
75
+ - v1-dep-{{ .Branch }}-
76
+ - v1-dep-master-
77
+
78
+ - run: sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 net.ipv6.conf.default.disable_ipv6=0 net.ipv6.conf.all.disable_ipv6=0
79
+ - run: rm -rf "$HOME/.go_workspace/src/$IMPORT_PATH"
80
+ - run: mkdir -p "$HOME/.go_workspace/src/$IMPORT_PATH"
81
+ - run: cp -aT . "$HOME/.go_workspace/src/$IMPORT_PATH"
82
+ - run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && make deps
83
+
84
+ - save_cache:
85
+ key: v1-dep-{{ .Branch }}-{{ epoch }}
86
+ paths:
87
+ - ~/.go_workspace
88
+ - ~/go1.11.linux-amd64.tar.gz
89
+ - ~/.go_workspace/src/gx/ipfs
90
+ - ./node_modules
91
+
92
+
93
+ - run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && curl -s https://codecov.io/bash > codecov
94
+ - run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && make -j 1 coverage/sharness_tests.coverprofile
95
+ - run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && bash codecov -cF sharness -X search -f coverage/sharness_tests.coverprofile
96
+ - store_test_results:
97
+ path: /tmp/circleci-test-results
98
+ # Save artifacts
99
+ - store_artifacts:
100
+ path: /tmp/circleci-artifacts
101
+ - store_artifacts:
102
+ path: /tmp/circleci-test-results
103
+
104
+workflows:
105
+ version: 2
106
+ test:
107
+ jobs:
108
+ - gotest
109
+ - sharness
circle.yml
deleted
-40
@@ -1,40 +0,0 @@
1
-machine:
2
- environment:
3
- TEST_NO_FUSE: 1
4
- TEST_VERBOSE: 1
5
- TEST_NO_DOCKER: 1
6
- TRAVIS: 1
7
- CIRCLE: 1
8
- IMPORT_PATH: "github.com/ipfs/go-ipfs"
9
- GOPATH: "$HOME/.go_workspace"
10
- GOBIN: "$GOPATH/bin"
11
- SERVICE: "circle-ci"
12
-
13
- post:
14
- - sudo rm -rf /usr/local/go
15
- - if [ ! -e go1.11.linux-amd64.tar.gz ]; then curl -o go1.11.linux-amd64.tar.gz https://storage.googleapis.com/golang/go1.11.linux-amd64.tar.gz; fi
16
- - sudo tar -C /usr/local -xzf go1.11.linux-amd64.tar.gz
17
-
18
- services:
19
- - docker
20
-
21
-dependencies:
22
- pre:
23
- # setup ipv6
24
- - sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 net.ipv6.conf.default.disable_ipv6=0 net.ipv6.conf.all.disable_ipv6=0
25
-
26
- override:
27
- - rm -rf "$HOME/.go_workspace/src/$IMPORT_PATH"
28
- - mkdir -p "$HOME/.go_workspace/src/$IMPORT_PATH"
29
- - cp -aT . "$HOME/.go_workspace/src/$IMPORT_PATH"
30
- - cd "$HOME/.go_workspace/src/$IMPORT_PATH" && make deps
31
-
32
- cache_directories:
33
- - ~/go1.11.linux-amd64.tar.gz
34
- - ~/.go_workspace/src/gx/ipfs
35
-
36
-test:
37
- override:
38
- - bin/circle.sh:
39
- pwd: "../.go_workspace/src/$IMPORT_PATH"
40
- parallel: true