This repository has been archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[patch] bugfix search edge size (#8)
- Loading branch information
Yusuke Kato
authored
Feb 8, 2019
1 parent
1c7eac1
commit e34345d
Showing
5 changed files
with
137 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,132 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
alias: | ||
default: &default | ||
working_directory: /go/src/github.com/yahoojapan/gongt | ||
docker: | ||
- image: circleci/golang:1.10.1 | ||
- image: circleci/golang:1.11.4 | ||
environment: | ||
GO15VENDOREXPERIMENT: 1 | ||
GOPATH: "/go" | ||
GO111MODULE: "on" | ||
LD_LIBRARY_PATH: /usr/local/lib | ||
environment: | ||
TEST_RESULTS: /tmp/test-results | ||
NGT_VERSION: 1.6.1 | ||
REPO_NAME: "yahoojapan" | ||
IMAGE_NAME: "gongt" | ||
GITHUB_API: "https://api.github.com/" | ||
- image: redis | ||
|
||
version: 2 | ||
jobs: | ||
test: | ||
<<: *default | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
key: gosum-{{ .Branch }}-{{ checksum "go.sum" }} | ||
- run: | ||
name: preparation | ||
name: install dependencies | ||
command: | | ||
mkdir -p $TEST_RESULTS | ||
sudo apt-get update | ||
sudo apt-get install cmake | ||
cd ~ | ||
git clone https://github.com/yahoojapan/NGT | ||
mkdir -p NGT/build | ||
cd NGT/build | ||
cmake .. | ||
make -j | ||
sudo make install | ||
go get -u github.com/jstemmer/go-junit-report | ||
cd /go/src/github.com/yahoojapan/gongt | ||
make init | ||
sudo apt-get install libhdf5-dev | ||
sudo -E make deps | ||
- run: | ||
name: run test | ||
name: preparation | ||
command: | | ||
trap "go-junit-report < ${TEST_RESULTS}/go-test.out > ${TEST_RESULTS}/go-test-report.xml" EXIT | ||
go test -v -race -coverprofile=coverage.out -covermode=atomic gongt.go gongt_test.go | tee ${TEST_RESULTS}/go-test.out | ||
go mod vendor | ||
- run: | ||
name: prepare bench | ||
name: run tests | ||
command: | | ||
sudo apt-get install libhdf5-dev | ||
make download | ||
make index | ||
rm -rf example | ||
go test -v -race -covermode=atomic -coverprofile=coverage.out ./... | ||
go tool cover -html=coverage.out -o coverage.html | ||
bash <(curl -s https://codecov.io/bash) | ||
- store_artifacts: | ||
path: ./coverage.html | ||
- save_cache: | ||
key: gosum-{{ .Branch }}-{{ checksum "go.sum" }} | ||
paths: | ||
- ./vendor | ||
versioning: | ||
<<: *default | ||
steps: | ||
- checkout | ||
- run: | ||
name: check | ||
command: | | ||
mkdir -p $HOME/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config | ||
LAST_COMMIT=`git log -1 --pretty=%B` | ||
VERSION=`git describe --abbrev=0 --tags` | ||
touch ./.tag | ||
if [ ! -z "`git diff $VERSION`" -o -z "$VERSION" ]; then | ||
VERSION=${VERSION:-'0.0.0'} | ||
MAJOR="${VERSION%%.*}"; VERSION="${VERSION#*.}" | ||
MINOR="${VERSION%%.*}"; VERSION="${VERSION#*.}" | ||
PATCH="${VERSION%%.*}"; VERSION="${VERSION#*.}" | ||
if echo $LAST_COMMIT | grep "\[\(major\|MAJOR\)\]" > /dev/null; then | ||
MAJOR=$((MAJOR+1)) | ||
echo "$MAJOR.0.0" > ./.tag | ||
elif echo $LAST_COMMIT | grep "\[\(minor\|MINOR\)\]" > /dev/null; then | ||
MINOR=$((MINOR+1)) | ||
echo "$MAJOR.$MINOR.0" > ./.tag | ||
elif echo $LAST_COMMIT | grep "\[\(patch\|PATCH\)\]" > /dev/null; then | ||
PATCH=$((PATCH+1)) | ||
echo "$MAJOR.$MINOR.$PATCH" > ./.tag | ||
fi | ||
fi | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- . | ||
push: | ||
<<: *default | ||
steps: | ||
- attach_workspace: | ||
at: . | ||
- run: | ||
name: run bench | ||
name: push tag and check PR body | ||
command: | | ||
make bench | ||
mkdir -p $HOME/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config | ||
TAG=`cat ./.tag` | ||
if [ ! -z "$TAG" ]; then | ||
echo $TAG | ||
git tag $TAG | ||
git push https://${GITHUB_ACCESS_TOKEN}:x-oauth-basic@github.com/${REPO_NAME}/${IMAGE_NAME} --tags | ||
# git push git@github.com:${REPO_NAME}/${IMAGE_NAME} --tags | ||
fi | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- . | ||
gh_release: | ||
<<: *default | ||
steps: | ||
- attach_workspace: | ||
at: . | ||
- run: | ||
name: release | ||
command: | | ||
mkdir -p $HOME/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config | ||
TAG=`cat ./.tag` | ||
if [ ! -z "$TAG" ]; then | ||
echo "Create release: ${TAG}" | ||
curl -H "Authorization: token ${GITHUB_ACCESS_TOKEN}" \ | ||
-X POST \ | ||
-d "{\"tag_name\": \"${TAG}\"}" \ | ||
${GITHUB_API}repos/${REPO_NAME}/${IMAGE_NAME}/releases | ||
fi | ||
workflows: | ||
version: 2 | ||
build: | ||
jobs: | ||
- test | ||
- versioning: | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
- push: | ||
requires: | ||
- versioning | ||
- gh_release: | ||
requires: | ||
- push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module github.com/yahoojapan/gongt | ||
|
||
require ( | ||
github.com/kpango/glg v1.2.7 | ||
gonum.org/v1/hdf5 v0.0.0-20180702054324-c257073619f4 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
github.com/kpango/fastime v1.0.0 h1:tZeI+eEyHHYKkTkKOiOZ5MeeRJmliuZlGV7aK7S2rkE= | ||
github.com/kpango/fastime v1.0.0/go.mod h1:Y5XY5bLG5yc7g2XmMUzc22XYV1XaH+KgUOHkDvLp4SA= | ||
github.com/kpango/glg v1.2.7 h1:aVnv89IIWXSFNOm93SnDQGIKF27Jzz9olieOL2b23Xc= | ||
github.com/kpango/glg v1.2.7/go.mod h1:sEwy6Va116x0eKdbVsilHPanIrsoE9AR/9vHwdo4ytQ= | ||
gonum.org/v1/hdf5 v0.0.0-20180702054324-c257073619f4 h1:3GnLlVt6JOlXwffishXEToqGjH7hx/G8UK7RP7HTqX0= | ||
gonum.org/v1/hdf5 v0.0.0-20180702054324-c257073619f4/go.mod h1:g+PDU5ogjIKcc3Cg4ALAK7X4c8bBQvPzPKWNW5NB7I0= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters