Skip to content

Commit

Permalink
Merge pull request #2 from ipfs/master
Browse files Browse the repository at this point in the history
Pull in upstream changes
  • Loading branch information
postables authored Mar 10, 2019
2 parents ca77ecc + 245c40b commit ab5e543
Show file tree
Hide file tree
Showing 275 changed files with 3,388 additions and 7,585 deletions.
107 changes: 47 additions & 60 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,62 @@
version: 2
version: 2.0

aliases:
make_out_dirs: &make_out_dirs
run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS/{unit,sharness}
restore_gomod: &restore_gomod
restore_cache:
keys:
- v3-dep-{{ .Branch }}-{{ checksum "~/ipfs/go-ipfs/go.sum" }}-{{ .Environment.CIRCLE_JOB }}
- v3-dep-{{ .Branch }}-{{ checksum "~/ipfs/go-ipfs/go.sum" }}-
- v3-dep-{{ .Branch }}-
- v3-dep-master-
store_gomod: &store_gomod
save_cache:
key: v3-dep-{{ .Branch }}-{{ checksum "~/ipfs/go-ipfs/go.sum" }}-{{ .Environment.CIRCLE_JOB }}
paths:
- ~/go/pkg/mod
- ~/.cache/go-build/


defaults: &defaults
working_directory: ~/ipfs/go-ipfs
shell: /bin/bash --login
environment:
GO111MODULE: "on"
TEST_NO_DOCKER: 1
TEST_NO_FUSE: 1
GOPATH: $HOME/.go_workspace
GOPATH: /home/circleci/go
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
CIRCLE: 1
SERVICE: circle-ci
TEST_NO_DOCKER: 1
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
TEST_VERBOSE: 1
TRAVIS: 1
IMPORT_PATH: github.com/ipfs/go-ipfs

docker:
- image: circleci/build-image:ubuntu-14.04-XXL-upstart-1189-5614f37
command: /sbin/init
- image: circleci/golang:1.11

jobs:
gotest:
<<: *defaults
steps:
- checkout
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
- run: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; '
- run: sudo rm -rf /usr/local/go
- 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
- run: sudo tar -C /usr/local -xzf go1.11.linux-amd64.tar.gz
- *make_out_dirs
- *restore_gomod

- restore_cache:
keys:
- v1-dep-{{ .Branch }}-
- v1-dep-master-
- run: make cmd/ipfs-try-build
- run: |
make -j 1 test/unit/gotest.junit.xml \
&& [[ ! $(jq -s -c 'map(select(.Action == "fail")) | .[]' test/unit/gotest.json) ]]
- run:
when: always
command: bash <(curl -s https://codecov.io/bash) -cF unittests -X search -f coverage/unit_tests.coverprofile

- 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
- run: rm -rf "$HOME/.go_workspace/src/$IMPORT_PATH"
- run: mkdir -p "$HOME/.go_workspace/src/$IMPORT_PATH"
- run: cp -aT . "$HOME/.go_workspace/src/$IMPORT_PATH"
- run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && make deps

- save_cache:
key: v1-dep-{{ .Branch }}-{{ epoch }}
paths:
- ~/.go_workspace
- ~/go1.11.linux-amd64.tar.gz
- ~/.go_workspace/src/gx/ipfs
- ./node_modules
- run:
when: always
command: mv "test/unit/gotest.junit.xml" /tmp/circleci-test-results/unit

- *store_gomod

- run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && curl -s https://codecov.io/bash > codecov
- run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && make -j 1 test/unit/gotest.junit.xml
- run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && bash codecov -cF unittests -X search -f coverage/unit_tests.coverprofile
- run: mv "$HOME/.go_workspace/src/${IMPORT_PATH}/test/unit/gotest.junit.xml" /tmp/circleci-test-results
- store_test_results:
path: /tmp/circleci-test-results
# Save artifacts
Expand All @@ -64,39 +67,23 @@ jobs:
sharness:
<<: *defaults
steps:
- run: sudo apt install socat
- checkout
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
- run: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; '
- run: sudo rm -rf /usr/local/go
- 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
- run: sudo tar -C /usr/local -xzf go1.11.linux-amd64.tar.gz
- *make_out_dirs
- *restore_gomod

- restore_cache:
keys:
- v1-dep-{{ .Branch }}-
- v1-dep-master-
- run: make -j 10 coverage/sharness_tests.coverprofile test/sharness/test-results/sharness.xml TEST_GENERATE_JUNIT=1 CONTINUE_ON_S_FAILURE=1

- 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
- run: rm -rf "$HOME/.go_workspace/src/$IMPORT_PATH"
- run: mkdir -p "$HOME/.go_workspace/src/$IMPORT_PATH"
- run: cp -aT . "$HOME/.go_workspace/src/$IMPORT_PATH"
- run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && make deps
- run:
when: always
command: bash <(curl -s https://codecov.io/bash) -cF sharness -X search -f coverage/sharness_tests.coverprofile

- save_cache:
key: v1-dep-{{ .Branch }}-{{ epoch }}
paths:
- ~/.go_workspace
- ~/go1.11.linux-amd64.tar.gz
- ~/.go_workspace/src/gx/ipfs
- ./node_modules
- run: mv "test/sharness/test-results/sharness.xml" /tmp/circleci-test-results/sharness
# make sure we fail if there are test failures
- run: find test/sharness/test-results -name 't*-*.sh.*.counts' | test/sharness/lib/sharness/aggregate-results.sh | grep 'failed\s*0'

- run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && curl -s https://codecov.io/bash > codecov
- run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && make -j 10 coverage/sharness_tests.coverprofile test/sharness/test-results/sharness.xml TEST_GENERATE_JUNIT=1 CONTINUE_ON_S_FAILURE=1
- run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && bash codecov -cF sharness -X search -f coverage/sharness_tests.coverprofile
- run: mv "$HOME/.go_workspace/src/${IMPORT_PATH}/test/sharness/test-results/sharness.xml" /tmp/circleci-test-results
- *store_gomod

# make sure we fail if there are test failures
- run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && ls test/sharness/test-results/t*-*.sh.*.counts | test/sharness/lib/sharness/aggregate-results.sh | grep 'failed\s*0'
- store_test_results:
path: /tmp/circleci-test-results
# Save artifacts
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ gx-workspace-update.json
bin/gx
bin/gx*
bin/tmp
bin/gocovmerge
bin/cover


vendor
Expand Down
2 changes: 1 addition & 1 deletion .gx/lastpubver
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.18: QmUJYo4etAQqFfSS2rarFAE97eNGB8ej64YkRT2SmsYD4r
0.4.19: QmPDEJTb3WBHmvubsLXCaqRPC8dRgvFz7A4p96dxZbJuWL
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit ab5e543

Please sign in to comment.