From 49c9608b605ffb7499445ef465948a6abdc978a8 Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Tue, 1 Oct 2019 19:39:13 -0700 Subject: [PATCH] Remove rakefile --- .circleci/config.yml | 12 +++++----- rakefile.rb | 47 --------------------------------------- tools/build.sh | 5 +++++ tools/dependencies.sh | 6 +++++ tools/integration_test.sh | 6 +++++ tools/lint.sh | 5 +++++ tools/unit_test.sh | 9 ++++++++ 7 files changed, 36 insertions(+), 54 deletions(-) delete mode 100644 rakefile.rb create mode 100755 tools/build.sh create mode 100755 tools/dependencies.sh create mode 100755 tools/integration_test.sh create mode 100755 tools/lint.sh create mode 100755 tools/unit_test.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index da42b67..248854d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,13 +19,11 @@ jobs: - run: | apt -y update --fix-missing apt -y install bundler rake - - run: rake deps - - run: rake lint - - run: rake build - - run: rake unit_test - - run: curl -sSL https://codecov.io/bash | bash - - run: rake integration_test - - run: rake install + - run: tools/dependencies.sh + - run: tools/lint.sh + - run: tools/build.sh + - run: tools/unit_test.sh + - run: tools/integration_test.sh - run: ./liche --version > version - persist_to_workspace: root: . diff --git a/rakefile.rb b/rakefile.rb deleted file mode 100644 index cf30c53..0000000 --- a/rakefile.rb +++ /dev/null @@ -1,47 +0,0 @@ -task :deps do - sh 'go get github.com/alecthomas/gometalinter' - sh 'gometalinter --install' - sh 'go get -d -t ./...' - sh 'gem install rake rubocop' - sh 'bundler install' -end - -task :build do - sh 'CGO_ENABLED=0 go build -o liche' -end - -task :unit_test do - sh 'go test -covermode atomic -coverprofile coverage.txt' -end - -task integration_test: :build do - sh 'bundler exec cucumber PATH=$PWD:$PATH' -end - -task test: %i[unit_test integration_test] - -task :format do - sh 'go fix ./...' - sh 'go fmt ./...' - - Dir.glob '**/*.go' do |file| - sh "goimports -w #{file}" - end - - sh 'rubocop -a' -end - -task :lint do - sh 'gometalinter ./...' - sh 'rubocop' -end - -task install: %i[deps test build] do - sh 'go get ./...' -end - -task default: %i[test build] - -task :clean do - sh 'git clean -dfx' -end diff --git a/tools/build.sh b/tools/build.sh new file mode 100755 index 0000000..8b3b577 --- /dev/null +++ b/tools/build.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +set -ex + +CGO_ENABLED=0 go build diff --git a/tools/dependencies.sh b/tools/dependencies.sh new file mode 100755 index 0000000..34b57ae --- /dev/null +++ b/tools/dependencies.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +set -ex + +go get github.com/golangci/golangci-lint/cmd/golangci-lint +go get -d ./... diff --git a/tools/integration_test.sh b/tools/integration_test.sh new file mode 100755 index 0000000..0939364 --- /dev/null +++ b/tools/integration_test.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +set -ex + +bundler install +bundler exec cucumber PATH=$PWD:$PATH diff --git a/tools/lint.sh b/tools/lint.sh new file mode 100755 index 0000000..9e115d1 --- /dev/null +++ b/tools/lint.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +set -ex + +golangci-lint run diff --git a/tools/unit_test.sh b/tools/unit_test.sh new file mode 100755 index 0000000..f30811a --- /dev/null +++ b/tools/unit_test.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +set -ex + +go test -covermode atomic -coverprofile coverage.txt + +if [ -n "$CODECOV_TOKEN" ]; then + curl -s https://codecov.io/bash | bash +fi