Browse Source

Refactor rakefile

renovate/configure
Yota Toyama 7 years ago
parent
commit
eb60230a21
  1. 9
      .circleci/config.yml
  2. 1
      .gitignore
  3. 0
      features/aruba.rb
  4. 0
      features/error.feature
  5. 0
      features/html.feature
  6. 0
      features/markdown.feature
  7. 0
      features/options.feature
  8. 0
      features/relative_path.feature
  9. 24
      rakefile.rb

9
.circleci/config.yml

@ -1,6 +1,5 @@
version: 2 version: 2
jobs: jobs:
build: build:
docker: docker:
- image: golang - image: golang
@ -26,8 +25,8 @@ jobs:
rake unit_test rake unit_test
curl -sSL https://codecov.io/bash | bash curl -sSL https://codecov.io/bash | bash
- run: - run:
name: Command Test name: Integration Test
command: rake command_test command: rake integration_test
- run: - run:
name: Build name: Build
command: rake build command: rake build
@ -36,7 +35,7 @@ jobs:
command: rake install command: rake install
- persist_to_workspace: - persist_to_workspace:
root: . root: .
paths: [ bin/liche, Dockerfile.test ] paths: [bin/liche, Dockerfile.test]
docker: docker:
docker: docker:
@ -51,4 +50,4 @@ workflows:
build: build:
jobs: jobs:
- build - build
- docker: { requires: [ build ] } - docker: { requires: [build] }

1
.gitignore

@ -1,3 +1,4 @@
bin bin
coverage.txt coverage.txt
liche
tmp tmp

0
examples/aruba.rb → features/aruba.rb

0
examples/error.feature → features/error.feature

0
examples/html.feature → features/html.feature

0
examples/markdown.feature → features/markdown.feature

0
examples/options.feature → features/options.feature

0
examples/relative_path.feature → features/relative_path.feature

24
rakefile.rb

@ -1,34 +1,24 @@
TOTAL_COVERAGE_FILE = 'coverage.txt'.freeze # This path is specified by codecov.
BIN_PATH = File.absolute_path 'bin'
task :deps do task :deps do
sh 'go get github.com/alecthomas/gometalinter github.com/mattn/goveralls' sh 'go get github.com/alecthomas/gometalinter'
sh 'gometalinter --install' sh 'gometalinter --install'
sh 'go get -d -t ./...' sh 'go get -d -t ./...'
sh 'gem install rake rubocop' sh 'gem install rake rubocop'
sh 'bundler install'
end end
task :build do task :build do
sh 'CGO_ENABLED=0 GOOS=linux go build -o bin/liche' sh 'CGO_ENABLED=0 go build -o liche'
end
task :fast_unit_test do
sh 'go test ./...'
end end
task :unit_test do task :unit_test do
sh "go test -covermode atomic -coverprofile #{TOTAL_COVERAGE_FILE}" sh 'go test -covermode atomic -coverprofile coverage.txt'
end end
task command_test: :build do task integration_test: :build do
sh 'bundler install' sh 'bundler exec cucumber PATH=$PWD:$PATH'
sh %W[bundler exec cucumber
-r examples/aruba.rb
PATH=#{BIN_PATH}:$PATH
examples].join ' '
end end
task test: %i[unit_test command_test] task test: %i[unit_test integration_test]
task :format do task :format do
sh 'go fix ./...' sh 'go fix ./...'

Loading…
Cancel
Save