mirror of https://github.com/nmasse-itix/liche.git
8 changed files with 154 additions and 0 deletions
@ -0,0 +1,32 @@ |
|||||
|
version: 2 |
||||
|
jobs: |
||||
|
build: |
||||
|
docker: |
||||
|
- image: golang |
||||
|
working_directory: /go/src/github.com/raviqqe/linkcheck |
||||
|
steps: |
||||
|
- checkout |
||||
|
- run: |
||||
|
name: Setup |
||||
|
command: | |
||||
|
apt -y update --fix-missing |
||||
|
apt -y install rake |
||||
|
apt -y install bundler rake |
||||
|
- run: |
||||
|
name: Dependencies |
||||
|
command: rake deps |
||||
|
- run: |
||||
|
name: Lint |
||||
|
command: rake lint |
||||
|
- run: |
||||
|
name: Unit Test |
||||
|
command: rake unit_test |
||||
|
- run: |
||||
|
name: Command Test |
||||
|
command: rake command_test |
||||
|
- run: |
||||
|
name: Build |
||||
|
command: rake build |
||||
|
- run: |
||||
|
name: Install |
||||
|
command: rake install |
||||
@ -0,0 +1,3 @@ |
|||||
|
bin |
||||
|
coverage.txt |
||||
|
tmp |
||||
@ -0,0 +1,2 @@ |
|||||
|
source 'https://rubygems.org' |
||||
|
gem 'aruba', '~> 0.14.2' |
||||
@ -0,0 +1,44 @@ |
|||||
|
GEM |
||||
|
remote: https://rubygems.org/ |
||||
|
specs: |
||||
|
aruba (0.14.2) |
||||
|
childprocess (~> 0.5.6) |
||||
|
contracts (~> 0.9) |
||||
|
cucumber (>= 1.3.19) |
||||
|
ffi (~> 1.9.10) |
||||
|
rspec-expectations (>= 2.99) |
||||
|
thor (~> 0.19) |
||||
|
builder (3.2.3) |
||||
|
childprocess (0.5.9) |
||||
|
ffi (~> 1.0, >= 1.0.11) |
||||
|
contracts (0.16.0) |
||||
|
cucumber (2.4.0) |
||||
|
builder (>= 2.1.2) |
||||
|
cucumber-core (~> 1.5.0) |
||||
|
cucumber-wire (~> 0.0.1) |
||||
|
diff-lcs (>= 1.1.3) |
||||
|
gherkin (~> 4.0) |
||||
|
multi_json (>= 1.7.5, < 2.0) |
||||
|
multi_test (>= 0.1.2) |
||||
|
cucumber-core (1.5.0) |
||||
|
gherkin (~> 4.0) |
||||
|
cucumber-wire (0.0.1) |
||||
|
diff-lcs (1.3) |
||||
|
ffi (1.9.18) |
||||
|
gherkin (4.1.3) |
||||
|
multi_json (1.12.1) |
||||
|
multi_test (0.1.2) |
||||
|
rspec-expectations (3.6.0) |
||||
|
diff-lcs (>= 1.2.0, < 2.0) |
||||
|
rspec-support (~> 3.6.0) |
||||
|
rspec-support (3.6.0) |
||||
|
thor (0.19.4) |
||||
|
|
||||
|
PLATFORMS |
||||
|
ruby |
||||
|
|
||||
|
DEPENDENCIES |
||||
|
aruba (~> 0.14.2) |
||||
|
|
||||
|
BUNDLED WITH |
||||
|
1.15.0 |
||||
@ -0,0 +1 @@ |
|||||
|
require 'aruba/cucumber' |
||||
@ -0,0 +1,5 @@ |
|||||
|
Feature: Markdown |
||||
|
Scenario: Check an empty markdown file |
||||
|
Given a file named "foo.md" with "" |
||||
|
When I successfully run `linkcheck foo.md` |
||||
|
Then the stdout should contain exactly "" |
||||
@ -0,0 +1,4 @@ |
|||||
|
package main |
||||
|
|
||||
|
func main() { |
||||
|
} |
||||
@ -0,0 +1,63 @@ |
|||||
|
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 'gometalinter --install' |
||||
|
sh 'go get -d -t ./...' |
||||
|
sh 'gem install rake rubocop' |
||||
|
end |
||||
|
|
||||
|
task :build do |
||||
|
sh 'go build -o bin/linkcheck' |
||||
|
end |
||||
|
|
||||
|
task :fast_unit_test do |
||||
|
sh 'go test ./...' |
||||
|
end |
||||
|
|
||||
|
task :unit_test do |
||||
|
sh "go test -covermode atomic -coverprofile #{TOTAL_COVERAGE_FILE}" |
||||
|
end |
||||
|
|
||||
|
task command_test: :build do |
||||
|
sh 'bundler install' |
||||
|
sh %W[bundler exec cucumber |
||||
|
-r examples/aruba.rb |
||||
|
PATH=#{BIN_PATH}:$PATH |
||||
|
examples].join ' ' |
||||
|
end |
||||
|
|
||||
|
task test: %i[unit_test command_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 %w[gometalinter |
||||
|
--disable gocyclo |
||||
|
--disable vetshadow |
||||
|
--enable gofmt |
||||
|
--enable goimports |
||||
|
--enable misspell |
||||
|
./...].join ' ' |
||||
|
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 |
||||
Loading…
Reference in new issue