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

1
.gitignore

@ -1,3 +1,4 @@
bin
coverage.txt
liche
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
sh 'go get github.com/alecthomas/gometalinter github.com/mattn/goveralls'
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 GOOS=linux go build -o bin/liche'
end
task :fast_unit_test do
sh 'go test ./...'
sh 'CGO_ENABLED=0 go build -o liche'
end
task :unit_test do
sh "go test -covermode atomic -coverprofile #{TOTAL_COVERAGE_FILE}"
sh 'go test -covermode atomic -coverprofile coverage.txt'
end
task command_test: :build do
sh 'bundler install'
sh %W[bundler exec cucumber
-r examples/aruba.rb
PATH=#{BIN_PATH}:$PATH
examples].join ' '
task integration_test: :build do
sh 'bundler exec cucumber PATH=$PWD:$PATH'
end
task test: %i[unit_test command_test]
task test: %i[unit_test integration_test]
task :format do
sh 'go fix ./...'

Loading…
Cancel
Save