# Golang CircleCI 2.0 configuration file # # Check https://circleci.com/docs/2.0/language-go/ for more details version: 2 jobs: build: docker: - image: circleci/golang:1.13 working_directory: /go/src/github.com/alibaba/shim-rune steps: - checkout - setup_remote_docker - run: name: run tests command: | test -z $(go fmt ./...) go vet -asmdecl=false ./... go test -race -v ./... - run: name: build binary command: | make binary - run: name: golangci-lint command: | curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.22.2 golangci-lint run --disable govet markdown-lint: docker: # run the steps with Docker - image: circleci/node:12 working_directory: ~/shim-rune steps: - checkout - setup_remote_docker - run: name: markdownlint command: | sudo npm install -g markdownlint-cli markdownlint -i vendor -f **/*.md - run: name: use markdown-link-check(https://github.com/tcort/markdown-link-check) to check links in markdown files command: | sudo npm install -g markdown-link-check set +e for name in $(find . -name \*.md | grep -v vendor); do if [ -f $name ]; then markdown-link-check -q $name; if [ $? -ne 0 ]; then code=1 fi fi done bash -c "exit $code"; - run: name: markdown-spellcheck command: | sudo npm install -g markdown-spellcheck find . -name \*.md | grep -v '^./vendor' | xargs mdspell --ignore-numbers --ignore-acronyms --en-us -r -x workflows: version: 2 ci: jobs: - build - markdown-lint